The best way to do this is to use a navigation controller.
In the AppDelegateWillFinishLaunchingWithOptions app, enter this ...
UINavigationController *navController = [[UINavigationController alloc] initWithRootViewController:<the view controller you want to use first>]; self.window.rootViewController = self.navController; [self.window makeKeyAndVisible];
This will launch your application using the NavigationController, and the first thing you see will be your initial controller.
To hide the panel ...
In the viewWillAppear part of your initial view controller ...
[self.navigationController setNavigationBarHidden:YES animated:YES];
This will hide the navigation bar for this controller.
To go to the new view controller ...
MyNewViewController *newVc = [[MyNewViewController... (set it up). [self.navigationController pushViewController:newVc animated:YES];
This is done using the initial view controller.
Then jump back. In the new VC, just do it ...
[self.navigationController popViewControllerAnimated:YES]
You will never own the navigation controller and you will never see it. It just sits at your application, managing transitions, etc.
source share