【发布时间】:2021-09-19 12:45:50
【问题描述】:
尝试快速开发登录页面,然后我想验证某些条件以返回错误。
从 print(Error.localizeDescription) 我得到了一些类似的回报
- 密码无效或用户没有密码。
- 没有与此标识符对应的用户记录。
如何根据 Error.localizeDescription 验证该条件?
Auth.auth().signIn(withEmail: email, password: pass, completion: {[weak self] result, Error in
guard let StrongSelf = self else{
return
}
if let Error = Error {
print(Error.localizedDescription)
}
guard Error == nil else{
// in here there is validation of return error (e.g. wrong password, account not exist)
self?.reasonLabel.isHidden=false
self?.reasonLabel.text=Error
return
}
self!.checkinfo()
})
【问题讨论】:
-
嘿劳维斯。这里有更新吗? ??????
标签: swift firebase firebase-authentication