I am setting my UICollectionViewController
's useLayoutToLayoutNavigationTransitions
property to 'YES' in order to perform layout to layout transitions for -[UINavigationController pushViewController:animated:]
and popViewControllerAnimated:
. In addition, I have implemented pinch gesture-based interactive transitions.
Also, I have defined a custom UICollectionViewTransitionLayout
that behaves differently from the original behavior of UICollectionViewTransitionLayout
. I create an instance of my "CustomLayoutTransition" object and return it from -[UICollectionViewDelegate collectionView:transitionLayoutForOldLayout:newLayout:]
.
I am expecting two behaviors when I do this
CustomLayoutTransition
is used to perform custom layout-to-layout transitions
1) when interactive transition is triggered by pinch gesture, or
2) when I push/pop an instance of UICollectionViewController
, e.g., by calling [UINavigationController pushViewController:animated:]
My expectation #1 seems to be correct, but #2 isn't; It seems that when I do push/pop programmatically, the original, Apple-provided UICollectionViewTransitionLayout
is used instead of my custom transition layout.
Is it normal that UICollectionViewTransitionLayout
is used instead of my custom transition layout in this circumstance?
If this is normal behavior, is there a way to use the custom transition to perform layout-to-layout transitions when programmatically pushing/popping UICollectionViewController
?