I am trying to see if the user is already logged in, and if he is, to bring him to a navigation controller, which contains the mainViewController.
This is in my scene delegate
if UserDefaults.standard.bool(forKey: "isLoggedIn") {
let homeViewController = UIStoryboard(name: "Main", bundle: nil).instantiateViewController(withIdentifier: "MainStoryBoard") as! MainViewController
let navigationController = UINavigationController(rootViewController: homeViewController)
window.rootViewController = navigationController
}
This is what it's supposed to look like
But, instead, it removes the navigation bar.