Created
November 14, 2016 19:50
-
-
Save ramakser/a0553f3f65998b061c3fd6bae08877bf to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
resultsSize contains the size of the data source array, self.results, before new data is added from the data at newImages. | |
[self.collectionView performBatchUpdates:^{ | |
int resultsSize = [self.results count]; | |
[self.results addObjectsFromArray:newImages]; | |
NSMutableArray *arrayWithIndexPaths = [NSMutableArray array]; | |
for (int i = resultsSize; i < resultsSize + newImages.count; i++) | |
[arrayWithIndexPaths addObject:[NSIndexPath indexPathForRow:i inSection:0]]; | |
[self.collectionView insertItemsAtIndexPaths:arrayWithIndexPaths]; | |
} completion:nil]; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment