I am building an app with Parse in swift. PFUser.currentuser() always returns nil after the app is stopped and run again. I am using the iOS simulator and the local datastore is enabled. I am using something like this -
if PFUser.currentuser() == nil {
// Perform segue to login screen
}
And for login I am using
PFUser.loginWithUsernameInBackground(...)
The currentuser remains till the app is restarted, after which it is reset to nil. I have even tried to pin the currentuser but it doesn't work. How can I check if the currentuser is being cached locally. Any help would be appreciated. Thanks.