I came to SO looking for a more elegant solution, but here's how I've been (successfully) doing it so far.
The basic idea:
- DO NOT use UINavigationController; instead use it's constituent parts (e.g. UINavigationBar) and do the work yourself
- Trigger the navbar to animate in parallel with your own custom animations (or not, if you want no anim at all)
The downsides:
- UINavigationController handles some other things, like memory loading/unloading, automatically. Also, it's "hard coded" into all UIViewControllers - they ALWAYS have a reference to the UINavigationController that contains them. It's a shame to throw all this away just because Apple doesn't provide a hook for setting custom anims.
Code - in whichever class takes over for the animation:
UINavigationItem *backItem = [[UINavigationItem alloc] initWithTitle:@"Back"];
[navigationController.navigationBar pushNavigationItem:backItem animated:TRUE];
// next line only needed if you want a custom back anim too
navigationController.navigationBar.delegate = self;
...if you also want to cut-in with custom back animation, you need that last line above, so that you can then listen to the navbar, and react in parallel, like this:
- (BOOL)navigationBar:(UINavigationBar *)navigationBar shouldPopItem:(UINavigationItem *)item
{
// trigger your custom back animation here
return TRUE;
}