Search code examples
iosobjective-ccore-animationuicollectionviewuicollectionviewlayout

Is there any way to call initialLayoutAttributesForAppearingItemAtIndexPath with some delay consecutively for collection view cell?


I am working on a UICollectionView that reload the cells animatedly. I have wrote an animation code in my layout class in

- (UICollectionViewLayoutAttributes*)initialLayoutAttributesForAppearingItemAtIndexPath:(NSIndexPath *)itemIndexPath 

And its works perfectly i just want to know is that somehow can i introduce an delay in cells animations so it will be like first cell reaches its place than second and then third cell and so far.

So is there any specific way to achieve this?


Solution

  • Unfortunately, the framework is not designed to work in that way. I would not animate the frames directly – that is a dark path that leads to pain. You'd basically need to add one model to the data source backing the collection view, wait, and repeat. It shouldn't be too hard, but it is a bit hacky.