当我在应用程序中多次按下按钮时,它会在AppDelegate中出现错误。
Thread 1: signal SIGABRT
这是我按钮的代码。如果您有任何疑问,请确保告诉我!
//import Firebase
//import SVProgressHUD
//import UIKit
@IBAction func logInPressed(_ sender: AnyObject) {
if emailTextField.text != "" || passwordTextField.text != "" {
FirebaseApp.configure()
Auth.auth().signIn(withEmail: emailTextField.text!, password: passwordTextField.text!) {
(user, error) in
SVProgressHUD.show()
if error != nil {
print(error!)
self.incorrect.isHidden = false
SVProgressHUD.dismiss()
} else {
self.incorrect.isHidden = true
SVProgressHUD.dismiss()
self.performSegue(withIdentifier: "Segue9", sender: self)
}
}
} else {
incorrect.isHidden = false
}
}
firebaseapp.configure((需要在 application:didfinishlaunchingwithoptions上调用:函数从 appdelegate appdelegate
可能发生崩溃,因为您正在调用两次。