 <p>Try commenting out the following line of code in your AppDelegate.swift file - </p> <pre><code>PFUser.enableAutomaticUser() </code></pre> <p>enableAutomaticUser() will log in an anonymous user once you call PFUser.logOut(), and the username for an anonymous user is nil.</p>