I'm using the new custom view controller transitions introduced in iOS 7 in combination with a UINavigationController. I implemented
-navigationController:animationControllerForOperation:fromViewController:toViewController:
in my UINavigationControllerDelegate
, implemented the UIViewControllerAnimatedTransitioning
protocol and the custom transition works beautifully.
However I'd like to prevent the shift animation in the navigation bar when pushing the view controller. Interestingly, the pop animation is fine and the navigation items are just alpha-faded instead of shifted. But the push animation shifts the navigation items from the right.
I found a partial solution by replacing -pushViewController:animated:
with -setViewControllers:animated:
and adding the new view controller to the viewControllers
array. This does the correct alpha fading animation - EXCEPT for the very first time the view controller is pushed on the stack. Subsequent pops/pushes are fine.
Any idea how to achieve this effect? Calendar.app and Photos.app also implement this, so it should be possible (though it might be a specific behavior when using collection views).
animationControllerForOperation
, the animation affects my content the way I'd expect, and the navigation bar fades (for both push and pops). – Rob