ios - UICollectionView with data source fetched from Photos - slow updates with big amount of photos -


i making the app detecting screenshots in photos library using old alaseetlibrary framework — please use new photos framework if can. problem is, when user has big photo library takes lot of time find screenshots. updating data source every time app opened.

here's code scanning photo library:

alassetslibrarygroupsenumerationresultsblock savedphotosblock = ^(alassetsgroup *group, bool *stop) {     if (group)     {         [group enumerateassetsusingblock:^(alasset *result, nsuinteger index, bool *stop)         {              if(result)              {                  alassetrepresentation *original = [result defaultrepresentation];                  cgsize dimensions = [original dimensions]; 

after work finished calling reloaddata(). how can update data on go possible interact uicollectionview while data source updating?

you should use performbatchupdate method. create array new indexpath added. call insertitemsatindexpaths:

instead of reloaddata


Comments

Popular posts from this blog

facebook - android ACTION_SEND to share with specific application only -

python - Creating a new virtualenv gives a permissions error -

javascript - cocos2d-js draw circle not instantly -