我是使用Swift 3的初学者 我收到错误:无法转换类型的值'(FIRUser,_) - > ()'预期参数类型为' FIRAuthResultCallBack?'
这是什么错误,如何解决?
func handleRegister() {
guard let email = emailTextfield.text, let password = passwordTextfield.text else{
print("Invalid Entry to Form")
return
}
FIRAuth.auth()?.createUser(withEmail: email, password: password, completion: {(user: FIRUser, error) in
if error != nil {
print(123456)
return
}
})
}
答案 0 :(得分:1)
请用以下代码替换您的代码:
FIRAuth.auth()?.createUser(withEmail: email, password: password, completion: { (user, err) in
if error != nil
{
print(123456)
return
}
})