In my Core Data model I have an entity which keeps URLs of images. I want to download these images so I can use them in my UICollectionView
model, which is an array of my Core Data entities. I want to always be able to access these images synchronously (assuming they have already been downloaded async) so there's no delay between them loading in their respective cell.
Currently, I am using an async method in the cellForIndexPath:
data source delegate method of the UICollectionView
but when the collection view is reloaded, if there are images still being downloaded, they get assigned to the wrong cell as cells have been inserted during this time.
This problem seems like it should be very obvious to solve but I cannot work it out.
Any ideas are greatly appreciated.
Thanks.