Ios – UICollection view reloadData cause recreate visible cell

iosreloaddatauicollectionviewuitableview

When I call reloadData method of UICollectionView it cause all visible cell to blink. I found that reason of this is recreation of all visible cells, while UITableView return visible cell in – tableView:cellForRowAtIndexPath: method after reload data.

So, how can I avoid recreation of visible cells in UICollectionView.

Best Answer

You need to reload the visible cells, which will not cause the flash seen during reloadData:

[myCollectionView reloadItemsAtIndexPaths:[myCollectionView indexPathsForVisibleItems]];

Related Topic