Creating insertItemsAtIndexPath in a UICollectionView not for animation

I use UICollectionsView insertItemsAtIndexPath and it is very annoying, so when I scroll through the UICollectionView and then call insertItemsAtIndexPath, it moves with the element. I want this insert to be seamless and just add it to the beginning, not knowing that something has been added on top. How can i do this?

+5
source share
1 answer

I assume that you will have to subclass UICollectionViewFlowLayout and then - (UICollectionViewLayoutAttributes *)initialLayoutAttributesForAppearingItemAtIndexPath:(NSIndexPath *)itemIndexPathjust return null. Thus, it will directly put it in the final position, and therefore, the animation should not take place.

+3
source

All Articles