Replies: 1 comment 1 reply
-
It is intended behavior, since it is hardly for Kingfisher to detect or determine if an plain image view set ( I'd say they are two different things instead of the "same coin". The imageView.kf.setImage(with: largeImageURL)
// cell reuse
imageView.kf.setImage(with: nil, placeholder: UIImage(systemName: "pencil")) Or say, even simpler, if you are going to use the "reused cell" immediately to load a new URL, you can even just skip the "pencil" image setting. Just set the new URL and Kingfisher did the trick behind scene to prevent the previous image from showing: // Cell delegate, eg `collectionView(_:cellForItemAt:)`:
imageView.kf.setImage(with: imageURL1, placeholder: UIImage(systemName: "pencil"))
// Later, another cell delegate method (reused)
imageView.kf.setImage(with: imageURL2, placeholder: UIImage(systemName: "pencil")) |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I ran into this issue while fixing a bug related to cell reuse. It would seem like an active download should be cancelled if an image is set manually before the download is finished.
What we need to do instead is:
This might be intended behavior, but I feel like this is very strange.
self.image=
andself.kf.setImage()
are two sides of the same coin. If you were to callsetImage
twice, the first call would automatically be cancelled, yet settingimage
directly is not safe.Beta Was this translation helpful? Give feedback.
All reactions