当我在我的应用程序上配置启动会话时,我遇到了一个小问题:“'AuthDataResult‘类型的值没有成员'isEmailVerification'”
func signIn(email:String?, password:String?) {
if email == nil || password == nil {
showAlert(title: "Login Error!", message: "All fields are required.")
} else {
SwiftLoader.show(animated: true)
Auth.auth().signIn(withEmail: email!, password: password!) { (user, error) in
SwiftLoader.hide()
if let err = error {
self.showAlert(title: "Login Error!", message: err.localizedDescription)
} else {
if (user?.isEmailVerification){ //error:"Value of type 'AuthDataResult' has no member 'isEmailVerification'"
self.sendEmailVerification()
}else{
self.showAlert(title: "", message: "Has iniciado sesión correctamente")
}
}
}
}
}
发布于 2018-06-07 01:23:42
返回的类型为包含用户对象FIRUser
的AuthDataResult
user?.user.isEmailVerified
您最好重命名回调,以避免在文档中看到此处的阅读混淆
https://stackoverflow.com/questions/50725957
复制相似问题