Gifu icon indicating copy to clipboard operation
Gifu copied to clipboard

UICollectionView cache image

Open lethianqt94 opened this issue 5 years ago • 1 comments

My uicollectionview has a list of cells which contains images. When I scroll up and down, cells show duplicate images. I think it causes by cache. I tried to set imageview.image = nil before set imageview's image by url but it's not working. Please help!

lethianqt94 avatar Apr 18 '19 10:04 lethianqt94

What worked for me was doing

imageview.image = nil
imageview.prepareForReuse()

inside of the prepareForReuse

monolithic-adam avatar Aug 02 '19 08:08 monolithic-adam