出于某种原因,我的这个功能不起作用。
@IBAction func signIn(_ sender: Any) {
if emailTextField.text !="" && passwordTextField.text !="" {
FIRAuth.auth()?.signIn(withEmail: emailTextField.text!, password: passwordTextField.text!, completion: user, error) in
if error != nil {
} else {
print("Sucessfully logged in");
}
}
performSegue(withIdentifier: CONTACTS_SEGUE, sender: nil);
}
这些是我得到的错误: http://prntscr.com/f2iuye
答案 0 :(得分:1)
使用此选项,您在完成处理程序
中的语法错误FIRAuth.auth()?.signIn(withEmail: self.emailTextField.text!, password: self.passwordTextField.text!) { (user, error) in
if error == nil {
print("Sucessfully logged in")
}
}