首先是我的代码:
if userNameTextField.text != "" && userPasswordTextField.text != "" {
Auth.auth().signIn(withEmail: userNameTextField.text!, password: userPasswordTextField.text!, completion: { ( user, error ) in
if user != nil {
// Sing in Sucessful, then programmactically switch to tabbar view controller
self.performSegue(withIdentifier: "loginSuccessSegue", sender: self)
print("Success!")
}
else {
// Sign in unsuccessful
if let myError = error?.localizedDescription {
print(myError)
}
else{
print("Error")
}
}
}
)}
当我测试我的应用程序时,即使用户没有被控制并且它在我的控制台上打印出错误,该按钮仍然执行了segue并在成功案例中更改了我的视图(它执行'loginSuccessSegue'即使符号in是不成功的,然后去了else循环)
我想知道我在这里做错了什么?
提前感谢您的帮助