I started porting my app to IOS8 recently and have observed a change of behaviours in both UICollectionView and UIAnimation.
In short, my app is a game using a collection view for displaying pictures and runs in parallel couple of "background" animations. When user press on a cell, the idea is to simulate a "push" button, the same user should be able to push several cells one after the other rapidly. In IOS7 and earlier version, everything was smooth.
However, since IOS8, when the user press one cell, he/she has to wait for the push animation to end prior to pressing on the next one.
At first i look into the changes from UICollectionView and UIAnimation in IOS8 and could find mostly two changes, one deals with the "auto-sizing" of cells; and the second one deals with the concept of additive animations.
After i started looking into the refresh function of the UICollectionView. Due to a bug in IOS7 , the classical call "reload data" didn't work and should have been replaced by the following:
NSMutableArray *indexPaths = [[NSMutableArray alloc] init];
for (int i = 0; i < [self.assets count]; i++) {
NSIndexPath *indexPath = [NSIndexPath indexPathForItem:i inSection:0];
[indexPaths addObject:indexPath];
}
[collectionView reloadItemsAtIndexPaths:indexPaths];
The code above works fine in IOS7 version. However, i realised that it is the call which actually make the push animation slower in IOS8. If it is simply removed, indeed the graphical update doesn't have (e.g. change of the cell colour) but the animations become fluid again and user can press one cell after the one rapidly and the push animations will occur.
Replacing the above code by ReloadData gains the change of colour when the user press on the cell, but lose the push animations. Also, an interesting behaviour comes from the code below:
WizzPlayViewCell *cell = (WizzPlayViewCell *)[collectionView cellForItemAtIndexPath:[NSIndexPath indexPathForRow:(position) inSection:0]];
[WizzAnimationManager pulseOnce:cell.foregroundCellImage toSize:scaleFactor withDuration:durationAnimation];
If i keep the old code ([collectionView reloadItemsAtIndexPaths:indexPaths]...) , the cell retrieves from the cellForItemAtIndexPath is the right one; therefore the push animation method can execute it. However, if i use the ReloadData method, the cell is null.
This is as far i got and i am really puzzled by the changes of IOS and do not see at the moment the relations between all misbehaviours.
Would you:
- have met similar issues when porting to IOS8 with UICollectionView or UIAnimation ? and how did you overcome them?
- have a view why the reloadItemsAtIndexPaths:indexPaths code is now blocking the main thread and do not allow to execute the next push animations?
- have some opinion why the cell is null when using Reloaddata instead?
- have some extra-ordinary approach to help addressing this issue ? :)
Thanks all in advance for experience and insights you may have .