I have a UITabBarController with three tabs: each is a navigation controller with a view controller embedded. Currently the tabController is the initial view controller. I would like to place an intro view controller with buttons that precedes the tabController, with buttons that segue to the tabController. I’m using Xcode 4.2 and storyboards.
Is this possible?
In my IntroViewController I call prepareForSegue. It is not working:
-(void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
if ([segue.identifier isEqualToString:@"tabSegue"]) {
FirstViewController *firstVC = [[FirstViewController alloc]init];
SecondViewController *secondVC = [[SecondViewController alloc] init];
ThirdViewController *thirdVC = [[ThirdViewController alloc]init];
self.tabBarController = segue.destinationViewController;
UINavigationController *navController1 = [[UINavigationController alloc]initWithRootViewController:firstVC];
UINavigationController *navController2 = [[UINavigationController alloc]initWithRootViewController:secondVC];
UINavigationController *navController3 = [[UINavigationController alloc]initWithRootViewController:thirdVC];
NSArray *tabViewArray = [NSArray arrayWithObjects:navController1,navController2,navController3, nil];
tabBarController.viewControllers = tabViewArray;
}
}
In summary, can you segue to a tabBarController?
As the comment states, I used self.tabBarController = segue.destinationViewController.