简体   繁体   中英

Adding Login View to an App using Tab Bar Controller

I've created a small iphone app that contains a tab bar controller that has been created on the MainWindow.xib. The App Delegate contains the root controller outlet. I'm wondering how I can work in a login screen that will direct the user to my view controller containing the tab bars.

Current Solution: On didFinishLaunchingWithOptions add subview "RootController" which loads my MainWindow.xib view with tab bars. Then call "presentModalViewController" to present the LoginViewController as a modal. On the login view controller, the login button click calls the AppDelegate to dismiss the modal.

Does anyone know of a better solution? Possibly a solution that doesn't load the page with tabs until after the user has logged into the app.

Thanks!

  • Make a separate View Controller (lets say A)
  • in didFinishLaunchingWithOptions check if user is logged in .. if not show A..
  • implement delegation and pass back login result to the app delegate...and then load the tab bar View

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