Answer the question
In order to leave comments, you need to log in
How to solve error in Swift cola using CocoaPods, Firebase?
https://codepen.io/Swift_u/pen/GejoOe
Line "Auth.auth().createUser(withEmail: email, password: password, completion: { (user: User?, error ) in
if error != nil {
print (error!)
return
}
})"
Throws an error: "Cannot convert value of type '(User?, _) -> ()' to expected argument type 'AuthDataResultCallback?' (aka 'Optional<(Optional, Optional) -> ()>')"
tell me how to solve it. Ps. (user: User?, error ) changed to (user: Auth, error )
Answer the question
In order to leave comments, you need to log in
This may be because it is NOT necessary to define the types of input parameters if they are already defined in the createUser method itself . Moreover, you defined the types of these parameters incorrectly.
Auth.auth().createUser(withEmail: email, password: password) { authResult, error in
// ...
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question