title: Going directly to Main View controller for already logged in user
body: <p>I have a loginViewController as my rootviewcontroller followed by the main screen and then other screens. My views follow push and pop approach. What I want is, if a user is already logged in my view should start from main screen else start from login screen, and if I logout from main screen it should go back to login screen and the push and pop structure should be maintained. I can achieve this using the modal transition, but I need to use push and pop approach, is this possible? Currently I have checked a already logged in condition in my appdelegate to set the rootview controller but it fails if I attempt to log out as its not present in my navigation controller stack.</p>
  
  <pre><code>if !alreadyLoggedin
  {
      let mainListVC = storyBoard.instantiateViewControllerWithIdentifier(“MainListViewController”)
      self.window!.rootViewController = mainListVC
  }
  else
  {
      let loginVC = storyBoard.instantiateViewControllerWithIdentifier("ViewController")
      self.window!.rootViewController = loginVC
  }
  </code></pre>