title: iOS Login / Sign Out Implementation in Swift
body: <p>I've been attempting to implement a Login / Logout Flow for an iOS app in swift. Here's my storyboard -</p>
  
  <p><a href="https://i.stack.imgur.com/TqL3t.png" rel="noreferrer"><img src="https://i.stack.imgur.com/TqL3t.png" alt="Main Storyboard"></a></p>
  
  <p>In the main view controller (which is the blue screen), I have the following code implemented to detect that if the user is already signed in, then to automatically take them to the table view controller - </p>
  
  <p>override func viewDidAppear(animated: Bool) {</p>
  
  <pre><code>    if PFUser.currentUser() != nil {
  
         self.performSegueWithIdentifier("test", sender: self)
  
      }
  </code></pre>
  
  <p>The issue is, that when i Sign In or Login through either one of the green screens, the Table View navigation bar appears different.  The 'Sign Out' button appears properly when the user opens the app and is already logged in, however, logging in or signing in through the green screens, the navigation bar contains a '&lt; Back' button.</p>
  
  <p>Can someone explain how a login / logout flow needs to be implemented in storyboard and programatically in Swift.  I've seen some Objective-C examples out there, but can't seem to find one in Swift.  If anyone has a good example, it would be really helpful.  </p>