ViewDidAppear for Tab Based Applications

I want to do something when a specific tab appears. Meaning, the user clicked the tab view tab button. viewDidAppear does not fire when this happens. How else can I connect to the click tab event?

+4
source share
2 answers

You can implement this

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

on your tab bar, so your viewDidAppear method will be called correctly.

+9
source

-tabBarController:didSelectViewController: into your tab bar delegate.

+1
source

Source: https://habr.com/ru/post/1308665/


All Articles