UITabBarController is the parent, and ViewControllers under the tabs are children. You can access the TabBarController from childViewControllers using the parentViewController property.
So, if you have a UITabBarController with 2 tabs that contain ViewController1 and ViewController2, you can use this line in any of them.
UITabBarController* tabBarController = (UITabBarController*)self.parentViewController;
David source share