Reputation: 1376
I am developing an app that consists of a Tab Bar Controller that points to 3 view controllers (all with tabs). In one of these tab views I've made a button and I want it to open a new view (without a tab at the bottom). This new view would need a navigation bar with a back button to return to the previous view, so I was thinking I need to create a navigation controller?
Essentially this is what I'm trying to do (I apologize for the poorly drawn diagram).
How can I get this new view (entirely independent of the tab bar controller) to display programatically? Would this require a navigation controller?
Upvotes: 0
Views: 99
Reputation: 535925
You are describing a presented view controller. Call presentViewController:animated:completion:
.
I very frequently do this with a navigation bar and a Back or Done button, just as you describe. But it's not a navigation controller or navigation interface; it's just a convenient way of showing the user how to get back.
For example, this is a presented view in one of my apps. The top is a navigation bar, and the cancel
button gets us back (call dismissViewController...
). The rest is a scrolling view (a UICollectionView) of buttons.
Upvotes: 3
Reputation: 9823
[myTabBar setSelectedIndex:1]
You may have to access the tabBar
like self.tabBarController
so… [self.tabBarController setSelectedIndex:1];
1
is index 1
in the tabbar's stack (this is like tapping a tabBar
button manually)
Upvotes: 0