When the user changes the selected tab of a UITabBarController
, is 开发者_StackOverflow社区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.
You can use tabBar:didSelectItem:
while implementing the UITabBarDelegate:
- (void)tabBar:(UITabBar *)tabBar didSelectItem:(UITabBarItem *)item
精彩评论