I’m trying to open my view controller (with storyboard) which is embedded in a navigation view from the scende delegate
i am doing something like this
let mainStoryboard:UIStoryboard = UIStoryboard(name: "Home", bundle: nil)
let homePage = mainStoryboard.instantiateViewController(withIdentifier: "HomeViewController") as! HomeViewController
self.window?.rootViewController = homePage
however i can’t see the navigation bar, i mean, i just see the viewcontroller content
i need to open the navigation view as well
thanks!
2
Answers
Is
HomeViewController
the name of yourUINavigationViewController
?If not, then this is expected.
Give your
UINavigationViewController
an identifier in the storyboard like you did forHomeViewController
and then replace:Try this and see if it gives you the result you want
Firstly, you need to make your NavigationController as the root vc, not the HomeViewController;
Secondly, the default Navigation bar style is transparent, if you want to see it, you can customise it, for example: