title: How do I handle returning users with the login to facebook functionality?
body: <p>I've been setting up an iOS app that will have login with Facebook capability. I'm using Swift, so I've been mostly following <a href="http://www.brianjcoleman.com/tutorial-how-to-use-login-in-facebook-sdk-4-0-for-swift/" rel="nofollow noreferrer">this guide</a> for Swift. In case the link goes stale: I believe it to be a howto and translation to Swift, of the on the 2.x version of <a href="https://developers.facebook.com/docs/facebook-login/ios/v2.3" rel="nofollow noreferrer">Facebook's "login with Facebook" buttton</a>.</p>
  
  <p>I'm seeing some issues though. As long as I clear the simulator everything works fine. If I log out and then log back in again, everything works fine. The issue is when I log in and then rebuild the app, then the login button will remember that I logged in previously (it reads "Log out"), but the access token <code>FBSDKAccessToken.currentAccessToken()</code> is nil and any calls to the graph api fail. According to the documentation, this should just work. What am I doing wrong? What are the next steps to try to determine what the problem is? </p>
  
  <p>I'm happy to post any code that may be relevant, however, very little of my code differs much from the boilerplate, and I'm not sure what may be relevant. </p>
  
  <p>Is it possible this is happening because I'm only using the simulator? </p>
  
  <p>Is it possible that I'm following the wrong examples? Most of the other <a href="https://stackoverflow.com/questions/28248182/ios-swift-and-facebook-sdk">examples for Swift</a> that I've run across demonstrate using <code>FBLoginViewDelegate</code> instead of <code>FBLoginButtonDelegate</code>.</p>