First, you should know in your view hierarchy where your TabBarController is. If this is not your root controller, find the UIViewController that invokes the TabBarController and get its link via segue or something like that.
Which may work for you, it accesses the tabBarController property in viewDidLoad first child UIViewController on the tab inside your tabViewController. All child ViewControllers tabBarController have this property.
For example, if the first UIViewController displayed in the tabBar is MyViewController, do the following:
- (void)viewDidLoad { UITabBar *tabBar = self.tabBarController.tabBar; UITabBarItem *tabBarItem1 = [tabBar.items objectAtIndex:0]; UITabBarItem *tabBarItem2 = [tabBar.items objectAtIndex:1]; }
source share