Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

An event fired when UITabBarController's 'selectedViewController' changes?

When the user changes the selected tab of a UITabBarController, is there an event fired to indicate that this specific action happened?

I know that viewDidLoad can get fired if the UIViewController wasn't loaded previously and in the case it was, a viewWillAppear gets invoked. But neither of these will tell me that the view was shown because the tab bar was selected.

like image 789
Jonas Anderson Avatar asked Mar 18 '11 00:03

Jonas Anderson


1 Answers

You can use tabBar:didSelectItem: while implementing the UITabBarDelegate:

- (void)tabBar:(UITabBar *)tabBar didSelectItem:(UITabBarItem *)item
like image 85
pablasso Avatar answered Nov 15 '22 08:11

pablasso