Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ios/107.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Firebase Ios Swift身份验证问题_Ios_Swift_Authentication_Firebase Authentication - Fatal编程技术网

Firebase Ios Swift身份验证问题

Firebase Ios Swift身份验证问题,ios,swift,authentication,firebase-authentication,Ios,Swift,Authentication,Firebase Authentication,我的代码不能正常工作。我创建了google firebase身份验证。我的密码坏了 @IBAction func loginClicked(_ sender: UlButton) { if let email = usernameText.text, let password = passwordText.text { Auth.auth().signIn(withEmail: email, password: password) {authResult,

我的代码不能正常工作。我创建了google firebase身份验证。我的密码坏了

    @IBAction func loginClicked(_ sender: UlButton) {
      if let email = usernameText.text, let password = passwordText.text { 
         Auth.auth().signIn(withEmail: email, password: password) {authResult, error in 
            self.makeAlert(titleInput: "Error", messagelnput:"Error")
    }
    self.performSegue(withldentifier: "goToViewController", sender: nil) 
    }
}
然后我写了这个代码。当您在登录页面上输入错误的电子邮件和密码时,将显示错误消息。但它也会转到另一个页面(主页,ldentifier:“goToViewController”)。我不想这样做。当我输入错误的电子邮件和密码时,我只想显示错误消息

我该怎么做?
感谢您的帮助

您需要在firebase的关闭响应中添加
performsgue

 @IBAction func loginClicked(_ sender: UlButton) {
      if let email = usernameText.text, let password = passwordText.text { 
         Auth.auth().signIn(withEmail: email, password: password) {authResult, error in 
           if error == nil { 
              self.performSegue(withldentifier: "goToViewController", sender: nil) 
           }
           else { 
              self.makeAlert(titleInput: "Error", messagelnput:"Error") 
            } 
        }
    }
}