简体   繁体   中英

Load UITabbarcontroller from a UIViewcontroller

I'm trying to develop a tab bar controller application with four UIViewControllers. I have already programed my app. Now I need to add Login in my App. I have added a separate UIViewcontroller for login (Which is not part of TabbarController). Login is working fine. How can I load UITabbarcontroller after login is success.

A solution to this is to create a UINavigationController to house the login view and when a login is complete you push the UITabViewController onto the Navigation Controller. It works well and you can just hide the navigation bar so the user doesn't just jump back to login(unless you want this).

You could also just swap out the rootviewcontroller of the window but I like the navigation controller solution better and you can easily popToRootViewController to go back to login when you want.

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.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM