简体   繁体   中英

Change the UIVIewController of a tab in UITabBarController

I have UITabBarController with 4 tabs. I have a login scene in 2nd tab.When user logins I want to replace the login scene with user profile scene. From next time onwards when ever user selects 2nd tab I want to show them the user profile scene. How is this possible?

While setting up tabViewController, check if user is logged in or not. If logged in then add Profile view as the first view for the second tab.

While in application after login if you want to change the tab then, on click of second tab present a login screen over the tabView controller. And after login dismiss the login screen. If logged in then display the content of profile screen.

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