I have an issue with loading UICollectionView. Data source is an array. The array might consist of up to 10k elements. After transitioning is done, it is taking a lot of time to create objects in the array.
I am not sure if it is the right way to load the array initially with n (<< 10k) elements and add the objects while scrolling.
Any advice would really be helpful. Thanks
If you are using Core Data, you can fetch in batches. If you are not using CD, then you need to implement your own mechanism to do the batching. Loading (and waiting!) for any number of objects to load is always a bad idea.
So the advice is: load the data in batches, on a background queue. Then every x (could be 1) loaded objects, post them back on the main thread so that your viewController can then reload or add the necessary cells in the collectionView.