Question

my app first viewController is UIViewController. and when user click button firstView disappear and push UITabViewController is it possible?

i can't find how to push UITabViewController from UIViewController.

Was it helpful?

Solution

UPDATE sorry, I misread TabVC for UITableViewController. Do you mean UITableViewController or UITabBarController? I'll leave my answer below anyways.

In this instance, it's usually best to have a UITabBarController be the root view object. Although it can be done, it's a messier implementation, in my opinion. I would in fact make the UITabBarController the root and display the UIViewController modally from that UITabBarController on launch.

The user would be presented with the UIViewController and when they clicked the button, dismiss that modal view, revealing the UITabBarController.


Just use a UINavigationController. Use the navigation controller to push the tableView as the second level in the hierarchy. As a bonus you'll get the back button for 'free' and you don't have to worry about delegates for getting back to the original UIViewController.

OTHER TIPS

you may try this:

self.tabBarController.selectedViewController
= [self.tabBarController.viewControllers objectAtIndex:2];

it should work because selectedViewController property contains view of selected tab.

First of all you have view controller . And make Second view controller which contain tabbarcontroller . Now just push second view controller . And add tabbarcontroller's view as a subview to second view controller .

Hope you gets it ..

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top