Enhanced transitioning between UICollectionView layouts in iOS
What is TLLayoutTransitioning?
TLLayoutTransitioning provides a TLLayoutTransition transition layout subclass and a UICollectionView+TLTransitioning category that combine to solve a few problems with collection view layout transitioning:
- UICollectionViewLayoutTransition does not handle content offset well, often leaving cells where you don’t want them. TLTransitionLayout provides elegant control of content offset with Minimal, Visible, Center, Top, Left, Bottom or Right placement options relative to one or more index paths.
- UICollectionViewLayoutTransition does not support supplementary views. TLTransitionLayout provides support for any supplementary view kinds specified in the initializer.
- -[UICollectionView setCollectionViewLayout:animated:completion] has serious known bugs in iOS7 and does not provide any animation options. TLLayoutTransitioning provides a robust alternative to this API with support for animation duration, 30+ easing curves and content offset control. This is done by using CADisplayLink to drive an interactive TLTransitionLayout as a non-interactive animation. Note that this approach may not perform as well as Core Animation with more complex cells.