开发者

UiTabBar hijack click

开发者 https://www.devze.com 2023-02-15 14:44 出处:网络
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 a

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];
0

精彩评论

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