S
S
Swift-U2019-03-04 20:51:20
Swift
Swift-U, 2019-03-04 20:51:20

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 )5c7d658a3ddf8914012086.png

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
doublench21, 2019-03-04
@Swift-U

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.
5c7d6b050fce6838464701.png

Auth.auth().createUser(withEmail: email, password: password) { authResult, error in
  // ...
}

https://firebase.google.com/docs/auth/ios/start

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question