Now I have four UITableViewControllers.
- A
- B1, B2
- C
I need the following effect:
- Select an item on A can push to B1
- Tap the rightBarButtonItem on B1 can flip horizontal to B2
- Tap the rightBarButtonItem on B2 can flip horizontal to B1
- Select an item on B1 or B2 can push to C
- Can pop to A at B1 or B2
All views (A, B1, B2 and C) should have NavigationBar.
Now I can navigate between A, B1, B2, C. I can also flip to B2 using the following code:
//self is B1
- (IBAction)b2ButtonPressed
{
B2ViewController* B2 = [[B2ViewController alloc] init];
B2.modalTransitionStyle = UIModalTransitionStyleFlipHorizontal;
[self presentModalViewController:B2 animated:YES];
}
But on B2 the NavigationBar is missing.
I have an app on my iPod touch has such feature. How can I make it myself?
If you show the view controllers by modal presenting, not by navigation controller’s push or pop, you should wrap a navigation controller for the view controller in order to show the navigation bar:
And don’t forget to setup left or right bar button item for navigation bar in your B2ViewController.