Навигационная панель не появляется после нажатия кнопки входа в систему, когда она переходит к контроллеру Home view, и я настроил свою раскадровку и положил все хорошо, но я думаю, что я застрял на этом этапе код.Навигация не отображается Xcode 8.1 iOS 10 Swift 3
На самом деле, нет никакого выделения, кроме кодирования, поэтому, как я делаю навигацию?
Code I используется для выполнения навигации
let vc = self.storyboard?.instantiateViewController(withIdentifier: "Home")
self.present(vc!, animated: true, completion: nil)
@IBAction func loginAction(_ sender: Any) {
if self.emailTextField.text == "" || self.passwordTextField.text == "" {
//Alert to tell the user that there was an error because they didn't fill anything in the textfields because they didn't fill anything in
let alertController = UIAlertController(title: "Error", message: "Please enter an email and password.", preferredStyle: .alert)
let defaultAction = UIAlertAction(title: "OK", style: .cancel, handler: nil)
alertController.addAction(defaultAction)
self.present(alertController, animated: true, completion: nil)
} else {
FIRAuth.auth()?.signIn(withEmail: self.emailTextField.text!, password: self.passwordTextField.text!) { (user, error) in
if error == nil {
//Print into the console if successfully logged in
print("You have successfully logged in")
//Go to the HomeViewController if the login is sucessful
let vc = self.storyboard?.instantiateViewController(withIdentifier: "Home")
self.present(vc!, animated: true, completion: nil)
} else {
//Tells the user that there is an error and then gets firebase to tell them the error
let alertController = UIAlertController(title: "Error", message: error?.localizedDescription, preferredStyle: .alert)
let defaultAction = UIAlertAction(title: "OK", style: .cancel, handler: nil)
alertController.addAction(defaultAction)
self.present(alertController, animated: true, completion: nil)
}
}
}
}
Навигационный контроллер имеет возможность отображать навигационную панель. Убедитесь, что он установлен или нет. – Amanpreet
Я обновил вопрос и включил навигационную панель –
Вы можете увидеть изображение –