I have a UITabBarController with a profile tab. I want to present a login view controller if the profile tab is pressed, but the user is not logged in. If the user presses cancel, I want the tab bar controller to have the same tab selected as before.
You need to use UITabBarControllerDelegate
-tabBarController:shouldSelectViewController:
or
-tabBarController:didSelectViewController:
Detect your profile controller and present login controller.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.