Reputation: 559
i`m wondering if its possible to push a TabbarController from UIViewController ?
what i want to do is: when the user opens the app it shows a View with two buttons to select the language he want, this view does not contain anything except the two buttons, no tab bar, no navigation bar.
after selecting the preferred language it should push a tab bar view with 5 tabs in it. each tab contain a tableview controller.
is it possible ? if yes please explain how to do it i`m little bit new for this :)
thank you in advance :)
Upvotes: 2
Views: 805
Reputation: 37729
Well you can add it as subview to UIWindow
of your app delegate. You have to make a property UIWindow of your AppDelegate class.
Now When in your UIViewController
button is pressed, do something like this:
- (void) buttonPressed:(id)sender{
AppDelegate *delegate = (AppDelegate *)[UIApplication sharedApplication].delegate;
UITabBarController *tab = [UITabBarController youWayOfInitializingIt];
[delegate.window addSubview: tab.view];
}
Upvotes: 1
Reputation:
I would try dragging out two different tab bar view controllers, one for each of your languages. Ctrl-drag each button on your UIViewController to its respective language's tab bar view controller and choose the type of transition you want. However, if you want to use the push transition I suggest embedding the original UIViewController in a navigation controller. You can do this by clicking on the UIViewController and then...
Editor --> Embed in ---> Navigation Controller
This will provide you with a navigation bar and a back button if the user wants to go back and change the language.
Upvotes: 0
Reputation: 15238
Sure, just present an UITabBarController from the UIViewController using presentModalViewController
.
Upvotes: 0