开发者

viewDidAppear for tabbar based apps

开发者 https://www.devze.com 2022-12-28 19:04 出处:网络
I\'d like to do something when a particular tab appears. 开发者_StackOverflow社区 Meaning, the user has clicked the tab view\'s tab button.viewDidAppear doesn\'t fire when this happens.How else can I

I'd like to do something when a particular tab appears. 开发者_StackOverflow社区 Meaning, the user has clicked the tab view's tab button. viewDidAppear doesn't fire when this happens. How else can I hook into the tab click event?


You can implement this

- (void)tabBarController:(UITabBarController *)tabBarController didSelectViewController:(UIViewController *)viewController{
  [viewController viewDidAppear:YES];
}

in your Tab Bar Delegate, so your viewDidAppear method will be called properly.


Implement -tabBarController:didSelectViewController: in your tab bar delegate.

0

精彩评论

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