When the user what to sign up or login it has error and get this error in the output "this class is not key value coding-compliant for the key containerView." this is the login code also signup has the same error and l'm sure it's a right codes.
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)
}
})
}
}
You have created a binding from a storyboard element, to an element in the corresponding swift file, with the name containerView. After that you have deleted the containerView variable in your swift file, but the binding still exists in the storyboard.
To solve this problem go to your storyboard, click on the view controller, like below:
After that, click on the connection inspector, to see all bindings of your viewcontroller and delete the binding from the containerView:
I have faced the similar problem, I created a segmentview under which I've kept a containerView and removed the default segue that came along with that container view. After that I renamed the container view controller name and connected as show segue. This was the problem which caused me to face this issue. When I changed the show segue to Embed segue the problem resolved.