Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

UITabBarController is possible to select the tab via code?

People also ask

What is a tab bar view controller?

Overview. Tab bar controllers are implemented by the UITabBarController class. They allow a user of to switch between multiple arbitrary view controllers by maintaining an array of UIViewControllers .

How to add tabs to tab bar controller?

To add a tab, first drag a new View Controller object to the storybard. Next control-drag from the tab bar controller to new view controller and select view controllers under Relationship Segue . Your tab bar controller will update with a new tab.


Use the selectedIndex property on the UITabBarController. More information can be found in the UITabBarController Class Reference.

controller.selectedIndex = 4;

or use

[controller setSelectedIndex:4];