ANAdvancedNavigationController is a subclass of UIViewController and works as a parent view controller.
- add ANAdvancedNavigationController as a static Library to your project
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
// create the viewControllers that are displayed
UIViewController *leftViewController = ...;
// create an instance of ANAdvancedNavigationController
ANAdvancedNavigationController *navigationController = [[ANAdvancedNavigationController alloc] initWithLeftViewController:leftViewController];
// set your instance of ANAdvancedNavigationController as your applicationDelegates rootViewController
self.window.rootViewController = navigationController;
[self.window makeKeyAndVisible];
return YES;
}
To push a viewController, simply call
- (void)pushViewController:(UIViewController *)viewController afterViewController:(UIViewController *)afterViewController animated:(BOOL)animated;
viewController
: the view controller, that will be pushedafterViewController
: the view controller, after whichviewController
should appear. Note: ifafterViewController
isnil
, all right view controllers will be popped andviewController
will be the first on the stack.animated
: push animated or not
Sample:
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
UIViewController *nextViewController = ...;
[self.advancedNavigationController pushViewController:nextViewController afterViewController:self animated:YES];
}