Do you simply need to know what the previous and next view controllers will be? Or do you need to specifically know whether a view controller was popped or pushed? You can implement the following method, which is defined by UINavigationControllerDelegate
:
- ( void )navigationController:( UINavigationController * )navigationController willShowViewController:( UIViewController * )viewController animated:( BOOL )animated
{
UIViewController * currentController = navigationController.visibleViewController;
UIViewController * nextController = viewController;
// Do whatever here.
}
If, however, you DO need to know whether a particular view controller was popped or pushed, then Matt Bridges' suggestion is the way to go.