4

I'm a newbie when it comes to coding and was wondering if there are any best practices when it comes to login/signup viewcontrollers?

My current setup is attached. It works but the from a UX standpoint it's not the best as it relies heavily on the viewDidAppear func in the Saved Places Table View Controller (e.g. to check if there is a user). Here are some of the issues I have with it:

  1. When you login - you will always see the table cells in Saved Places Table View Controller before the login pops up
  2. When you logout - you again see the table cells in Saved Places Table View before the login pops up

My ideal user experience would be something like Twitter or Instagram. Where would you place in the Login in the storyboard to acheive this? Could you do something like Controller -> Login VC - Homepage VC or a separate Login VC that gets activated in the App Delegate?

login VC

Thanks in advance!

Danny
  • 190
  • 1
  • 12
  • 1
    If you want to force the user to login every time then place then place your login VC before the home navigation controller and segue to that from the login VC. You may need to add a navigation controller to the login vc depending on how you handle signup. – MwcsMac Feb 23 '16 at 18:58
  • See this question: http://stackoverflow.com/questions/19962276/best-practices-for-storyboard-login-screen-handling-clearing-of-data-upon-logou – Stephan Jul 01 '16 at 10:55

1 Answers1

2

Here is what I do: I have a VC called "LaunchViewController". This VC is the initial view that loads when the app starts. It runs a little piece of code that says "If the user is logged in, then go to the app (through a segue), but if the user is not logged in, then to go the log in view controller (through another segue)." I will post a screen shot of my storyboard for reference.

Ryan Westcott
  • 199
  • 3
  • 14