I am stumped on this. Here is my scenario. In my Appdelegate, I am creating
As the above, to avoid this issue, you can do this:
1. when reload collectionView:
[self.collectionView reloadData];
[self.collectionView layoutIfNeeded];
2. when invoke the batch updates:
[self.collectionView performBatchUpdates:^{
...
[self.dataSource addDataSource:moreDatas];
NSMutableArray *addIndexPaths;
...
if (self.dataSource.count == 1 ||
[self.collectionView numberOfItemsInSection:0] == self.dataSource.count){
[self.collectionView reloadData];
}else{
[self.collectionView insertItemsAtIndexPaths:addIndexPaths];
}
} completion:^(BOOL finished) {}];