当我在我的应用程序中多次按下我的按钮时,它在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
}
}
答案 0 :(得分:1)
需要在应用程序:didFinishLaunchingWithOptions:函数中调用 AppDelegate
中的FirebaseApp.configure()可能发生了崩溃,因为你正在调用它两次。