UICollectionView accumulates animation for various batch updates

I am having a problem with UICollectionView animations compared to various batch updates. I am using this code:

 [collectionView performBatchUpdates:^{ if (touched) { [collectionView deleteItemsAtIndexPaths:markedItems]; [collectionView insertSections:newSec]; } else { [collectionView deleteSections:newSec]; [collectionView insertItemsAtIndexPaths:markedItems]; } } completion:nil]; 

Here's a video of what I'm trying to do, and problems . The idea is that when you touch an image, it will animate it from above, like a new main image, and disappear with other images. The problem is that when you go back and touch another image, it will animate this new touching image and the previous image.

I believe this is a UICollectionView error and I cannot find a workaround.

Here is a sample project if you want.

+4
source share
1 answer

I contacted Apple. Their engineers said that this is really a mistake in UIKit, and I don’t know how to work there, and that I have to wait for the next major iOS preview releases (iOS 7) to check if this fixes the problem.

0
source

All Articles