Reputation: 33140
I created an application that started with UITabBarController
Something like this:
Now I want to refer that that UITabBarController in the code. How am I supposed to do so?
Should I right drag to application delegate? (Doesn't work).
I could use instantiateViewControllerWithIdentfier: but I do not want to create a new UITabBarController. I want to refer to the existing one.
Upvotes: 0
Views: 352
Reputation: 104092
Where in code do you want to refer to it? If it's one of the controllers that the tab bar controller manages, then you can use self.tabBarController. If it's from the appDelegate you can use self.window.rootViewController.
Upvotes: 1