I have a UICollectionView with UICollectionViewFlowLayout. While testing with large data (5,000+ cells) I noticed a lag when loading. I found out that at loading the sizeForItemAtIndexPath
is called for EVERY cell. Since I am doing a messaging like application and each cell is of different height, this causes height estimation to occur. I am not scrolling to the bottom or anything, just loading the view.
I have made a small app demonstrating what I am saying (look at the console to see that it is calling sizeForItemAtIndexPath
for all cells) https://github.com/ftheo/CollectionViewLoadingBug
Any help would be appreciated. Thanks