Reputation: 681
I'm using a code that programmatically creates a UITabBarController
in appDelegate. What I already have is a TabBarController created in the StoryBoard. I want to reference my TabBarController(from storyboard) to appDelegate and replace the UITabBarController
which was programmatically created. How do I do that?
Upvotes: 0
Views: 68
Reputation: 96
You can use the code below:
UIStoryboard *storyboard = [[UIStoryboard alloc] initWithStoryboard:[UIStoryboard storyboardWithName:@"YourStoryboardName" bundle:[NSBundle mainBundle]]];
UITabBarController *tabBarController = [storyboard instantiateViewControllerWithIdentifier:@"YourTabBarControllerIDInStroyboard"];
Upvotes: 2