If this other UIViewController is contained in the UINavigationController, you can simply call:
UINavigationController *navController = self.navigationController;
from the UIViewController.
Otherwise, you can set the UINavigationController as a property in AppDelegate.
// AppDelegate.h @property (nonatomic, strong) UINavigationController *navController;
Then select appDelegate.navController
.
Or you can set the UINavigationController as the rootViewController window:
[window setRootViewController:navController]
And call from anywhere:
UINavigationController *navController = window.rootViewController;
source share