使用Firebase身份验证时出现多个错误(Swift 3)

时间:2017-04-30 13:02:13

标签: ios swift xcode cocoa-touch

出于某种原因,我的这个功能不起作用。

@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

1 个答案:

答案 0 :(得分:1)

使用此选项,您在完成处理程序

中的语法错误
FIRAuth.auth()?.signIn(withEmail: self.emailTextField.text!, password: self.passwordTextField.text!) { (user, error) in
    if error == nil {
        print("Sucessfully logged in")
    }
}