0

Problem: 800 pictures come from server in NSMutableArray so when open UICollectionView then 10 minutes wait for loading 800 pictures..

So I want to first 12 picture when i first time open UICollectionView then send request to server when i scroll UICollectionView for fetch next 12 picture load. How it is?

1 Answers1

1

Don't do it that way. Just cache and load the images asynchronously(in the background) one at a time. The main thread won't be halted so there will be no delay when swiping.

Here are related questions/projects with code that should suffice:

https://github.com/Haneke/Haneke

https://github.com/rs/SDWebImage

Caching an Image and UICollectionView

Community
  • 1
  • 1
keji
  • 5,947
  • 3
  • 31
  • 47