Search code examples
iosswiftuinavigationcontrolleruinavigationbarswift4

Navigation bar disappear after segue


I'm trying to adding a navigation controller and to associate it with the home (and of course the controllers that are connected to the home)

enter image description here

this because i prefer to not have the navigation controller in the first 3 VC (storyboard entry, login and sign up). My problem is that after a simple self.performSegue(withIdentifier: "goToHome1", sender: self) from one of the first three VC the navigation bar disappear, is the first time i'm going to add a navigation controller and until now i always used only this formulaself.performSegue(withIdentifier: "goToXcontroller", sender: self) to switch from one controller to another so maybe i have to change something to fix this problem? I also tried to find some tutorial about NC but i didn't find something clear that help me with this.


Solution

  • You have to create segue to your UINavigationController instead of home view controller. You are skipping navigation controller by directly using segue to home view controller.

    Rootviewcontroller of your navigation controller is Home view controller. So if you create a segue to your navigation controller, it will open your home view controller with navigation bar.