title: How to implement an iOS login screen that only appears for unauthenticated users
body: <p>I know this question is a bit open-ended but I'm trying to make it as specific as possible because I don't really know what a standard convention would be for this type of thing with iOS.  I have been looking into implementing a login screen on my app, however I am having trouble figuring out the best way.  I have three methods listed below, could anybody tell me if one of these is better or a more correct approach?  (or if there is something that I totally missed).</p>
  
  <p>The first approach - I initially have a navigation controller as my root controller with the login screen being the first view on the stack.  Then when the user logs in, i just push the main UI to the stack.  The user can then use the back button to return to the login screen.  I know this technique works but then when re-launching the app, the user doesn't need to login again.  I'm not sure should I just set up the stack the same way (login page first) and then push the main UI on top?  Is that a common technique?</p>
  
  <p>The next approach, I found here how to replace the root controller <a href="https://stackoverflow.com/questions/6675730/how-to-change-rootviewcontroller-in-appdelegate-from-within-customviewcontroll">How to change RootViewController (in AppDelegate) from within CustomViewController?</a> I like this idea better where I could just get rid of the login screen after login and add some type of button to bring it back on logout.  Then during re-launch I can just skip adding the login screen altogether.</p>
  
  <p>The third approach is perhaps overlaying the login on top of the main UI but I haven't found any code to do this.  It also seems a little weird because my main UI might start firing messages that i wouldn't want to occur until after login so I'd have to account for that.</p>