Created
January 4, 2015 05:56
-
-
Save NghiaTranUIT/604c8f4ce607ade8506c to your computer and use it in GitHub Desktop.
This file contains hidden or 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
-(void) addNewItemFromArray:(NSArray *) newArrItem | |
{ | |
// Add | |
[_arrPhotos addObjectsFromArray:newArrItem]; | |
NSMutableArray *arrNewIndexpath = [NSMutableArray array]; | |
for (NSInteger i = _arrPhotos.count ; i < _arrPhotos.count + newArrItem.count ; i++) | |
{ | |
NSIndexPath *newIndexPath = [NSIndexPath indexPathForRow:i inSection:0]; | |
[arrNewIndexpath addObject:newIndexPath]; | |
} | |
// Add new item with animation | |
[_collectionView performBatchUpdates:^{ | |
[_collectionView insertItemsAtIndexPaths:arrNewIndexpath]; | |
} completion:^(BOOL finished) { | |
}]; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment