I have a CollectionView which displays images to the user. I download these in the background, and when the download is complete I call the following func to update
CollectionView
Get current available cells
// get visible cells let visibleIndexPaths = followedCollectionView.indexPathsForVisibleItems
Then check if your indexPath is contained in the visibleIndexPaths array or not, before doing anything with cells.
indexPath
visibleIndexPaths