Search code examples
iphoneiosuikituicollectionview

UICollectionView insertItem -> adjust animation time?


So, I have a UICollectionView where I insert new items.

I used the most of the suggestions from the Collection View Programming Guide - section "Making Insertion and Deletion Animations More Interesting"

Is there a way to adjust the animation time? (Maybe I just missed it in the docs, but couldn't find any info on this)

PS: If I could edit the curve that would be cool too. You know Ease-In-Out and so forth.


Solution

  • Note. Decades later, the syntax is like ..

    coll.forFirstBaselineLayout.layer.speed = 5.0
    

    You can change any animation speed with CALayer. So for UICollectionView this looks like the following:

    [self.collectionView.viewForBaselineLayout.layer setSpeed:0.1f];
    

    And you can change back the original speed:

    [self.collectionView.viewForBaselineLayout.layer setSpeed:1.0f];