Wednesday, January 15, 2014

UIViewControllerTransitioningDelegate vs. UINavigationControllerDelegate

In my previous post I wrote about using iOS 7's new customization animations for transitioning between UIViewControllers. What I didn't realize is that the mechanism by which a UINavigationController customizes its transitions is different from the way other UIViewController subclasses do.

I had declared that my custom UINavigationController conformed to the UIViewControllerTransitioningDelegate protocol and had coded up the required protocol methods and the different animation controllers (UIViewControllerAnimatedTransitioning) and then was deflated when nothing was calling my UIViewControllerTransitioningDelegate methods.

Upon further research I found that my navigation controller actually needed its 'delegate' property set to an object conforming to the UINavigationControllerDelegate protocol and this object would serve up the appropriate animation controllers for the push and pop operations.

It was a slightly difficult distinction to find, but once I implemented the methods I found that (half) my animations (nearly) worked. 

No comments:

Post a Comment