Reputation: 6604
I have a UINavigationController
in the root of my UITabBarController
. I have another UITabBarController
that I am presentint on top of the existing UITabBarController
.
However, when I do, the UITabBar
from the UITabBarController
I'm presenting does not get pushed on top of the existing one from the original UITabBarController
. Is there any way to get this functionality?
Upvotes: 1
Views: 1391
Reputation: 1742
First, you need to take reference of root viewController (UINavigationController) Like
UINavigationController *rootController = self.tabBarController.navigationController;
Or, If you added navigation controller in tabbar. then
UINavigationController *rootController = self.navigationController.tabBarController.navigationController;
Now, Create object of controller which you want to push.
UITabBarController *tabbarController;
And push into root controller
[rootController pushViewController:tabbarController animated:YES];
Upvotes: 5
Reputation: 2600
from you question this is what I have assumed.
StoryBoard Config
Simulator Output
Upvotes: 2