I've seen similar questions here, but not with a clear answer. So I have one modal login view with the classic username/password form, a Facebook login button and a Sign Up button which I would like to show when the user starts the app for the very first time. From what I found there are two ways to implement this, with shortcumings.
- in AppDelegate's didFinishLaunchingWithOptions a conditional is set to check if the user is logged in. If not the rootViewController is set to the loginViewController. After a succesful login a segue takes place to the main view of the app. My problem with this aproach is that I am not sure how to reset the rootViewController to the main view. Is that possible and how?
Are there any other ways to show the login modal without setting the rootViewController? Meaning I would keep ther rVC to the main view.
in the main view controller in the viewDidAppear a conditional checks if the user is logged in. If not a segue to the loginVC is performed. When the user succesfully logs in he is returned to the main view which dismissed the modal login view. The problem with this aproach is that the main view is briefly shown, which I would prefer not to do.
Any other ideas? Please let me know what is the best practice when it comes to this scenario. Thank you in advance,
