What is the default animation duration for UIColle

2019-02-17 11:13发布

问题:

Say I do this:

[self.collectionView setCollectionViewLayout:myNewLayout animated:YES];

What is the duration of the animation that happens?

My application of this is that I'm animating layer properties inside the cells when this changes, and because layer animations don't get caught by UIView's block-based animations, I have to do it separately with my own animation block.

回答1:

It you know you're inside a UIView animation, then [CATransaction animationDuration] will give you what you need.