I am trying to use Parse written with Swift. I am able to log in without any trouble but I am struggling with telling my app that the user is logged in.
I am using logInWithUsernameInBackground and I simply want to return a boolean if the log in succeeded.
When I use:
func authenticateUser() -> Bool{
PFUser.logInWithUsernameInBackground(userName.text, password: passwordField.text, block: {
(user,error) in
return error === nil
})
}
I get the error "Bool is not convertible to Void" which makes sense.
So if I change line 3 to read:
(user,error) -> Bool in
I end up with the error "Missing argument for parameter selector in call"
However, This method doesn't require a selector parameter.
So where am I going wrong? How do I return a bool based on whether or not there was an error at log in?