I\'m trying to figure out how to catch the event that controls the switch tabs on the
UITabBarController
. How could I accomplish this?
If you are using storyboard, do this
in didFinishLaunchingWithOptions
UITabBarController *tabBar = (UITabBarController *)self.window.rootViewController;
[tabBar setDelegate:self];
Also in AppDelegate, keep
And then
-(void) tabBarController:(UITabBarController *)tabBarController didSelectViewController:(UIViewController *)viewController
{
//Write your code here
}