开发者

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

开发者 https://www.devze.com 2023-02-17 08:30 出处:网络
When the user changes the selected tab of a UITabBarController, is 开发者_StackOverflow社区there an event fired to indicate that this specific action happened?

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
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号