title: How to check if a user is logged in and if not redirect to the login screen
body: <p>I have my login screen embedded in a <code>UINavigationController</code> and my home page screen embedded in a <code>UITabBarController</code>. </p>
  
  <p>My login page was done programmatically and <code>TabBarController</code> was created using <code>storyboards</code>. In <code>AppDelegate.swift</code> file I made the the login screen the <code>rootViewController</code>.</p>
  
  <p>But now I want to check if the user is logged in and make the <code>TabBarController</code> the <code>rootViewController</code>, and if the user isn't logged in, redirect to the login screen, then segue to the <code>TabBarController</code> and make it the <code>rootViewController</code>. </p>
  
  <p>The server authenticates the user by sending a <strong>token</strong> to the client. Do I store the token using <code>NSUserDefaults</code>? Should I check if the user has <code>_token</code>_ as a way to validate if the user is logged in?</p>