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
Post a Comment