当用户注册或登录时出现错误,并在输出中显示此错误“该类与密钥containerView的密钥值不兼容”。 这是登录代码,也注册有相同的错误,我确定这是正确的代码。
import UIKit
import Firebase
class LoginViewController: UIViewController {
@IBOutlet var Aemeil: UITextField!
@IBOutlet var Apassword: UITextField!
override func viewDidLoad() {
super.viewDidLoad()
}
@IBAction func login (_ sender : Any){
guard let email = Aemeil.text, let password = Apassword.text
else {
print("Form is not valid")
return
}
Auth.auth().signIn(withEmail: email , password: password , completion: { (user,error) in
if error == nil{
let vc = self.storyboard?.instantiateViewController(withIdentifier: "AHome");
self.present(vc!, animated: true, completion: nil);
print("Home page open")
}
else{
let alertController = UIAlertController(title: "Error", message: error?.localizedDescription, preferredStyle: .alert)
let defaultAction = UIAlertAction(title: "Yes", style: .cancel, handler: nil)
alertController.addAction(defaultAction)
self.present(alertController, animated: true, completion: nil)
}
})
}
}