Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using a KFImage multiple times results in just one being loaded (until cached) #1758

Closed
3 tasks done
solidcell opened this issue Jul 24, 2021 · 1 comment
Closed
3 tasks done

Comments

@solidcell
Copy link

solidcell commented Jul 24, 2021

Check List

Thanks for considering to open an issue. Before you submit your issue, please confirm these boxes are checked.

Issue Description

What

If an image is not already cached, and a View tries to use it multiple times, only one of those usages will show the image once it loads. You need to navigate to the page again (now that the image is cached) to have it actually show all of them.

Reproduce

struct SwiftUIView: View {

    let image = KFImage(URL(string: "https://github.com/onevcat/Kingfisher/blob/master/images/kingfisher-1.jpg?raw=true")!)

    var body: some View {
        VStack {
            image
            image
        }
    }
}
@onevcat
Copy link
Owner

onevcat commented Jul 25, 2021

Ummm. I guess it is another issue related to the ObservedObject limitation mentioned in #1660

Some fixes were already applied on the master branch, but it requires iOS 14 or above. If you do not need to support iOS 13 anymore, maybe it would be a good chance to try and check if the master branch can solve this issue for now.

A major upgrade is in plan now with those fixes and we are going to release some beta version soon.

@onevcat onevcat closed this as completed Dec 16, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants