UiTabBar hijack click
I have a UITabBar and on the last tab, visually 5th, i want to make it logout the user amd not show a view. I then want the 1st tabbar item t开发者_Go百科o be selected afyer logout is successful. Has anyone seen how to do this?
Tia
Something like this should do the trick:
The UITabBarControllerDelegate has a method:
- (BOOL)tabBarController:(UITabBarController *)tabBarController shouldSelectViewController:(UIViewController *)viewController
Check this for the fifth item and return NO, then after the process of logging out is complete, set the tab to 1 programatically.
[tabBar setSelectedItem:firstController];
精彩评论