UITabBarController displays all the information needed to create a tab bar item for each view controller by checking the view controller itself.
All you have to do is assign an array of view controllers using -setViewControllers:animated:
After adding the view controller to the tab bar controller, the tab bar controller will check the tabBarItem property of the tabBarItem controller. This tab bar item will automatically be inserted into the tab bar of the tab bar panel. You can initialize the tab bar in each view controller programmatically. It looks something like this ...
UITabBarItem *tabBarItem = [[UITabBarItem alloc] initWithTitle:@"Title" image:[UIImage imageNamed:@"someImage"] tag:1];
or if you want to use one of the elements of the system ...
UITabBarItem *tabBarItem = [[UITabBarItem alloc] initWithSystemItem:UITabBarSystemItemFeatured tag:1];
I suggest you take a look at UITabBarController , UITabBarItem and UIViewController and read about the corresponding properties. Documents are filled with irreplaceable information.
source share