Unable to remove navigation controller in Swift

So, I have a simple navigation controller with a signature, a hit, and you go to the home page. The problem is when you go to the home page following the navigation controller.

enter image description here

enter image description here

As you can see in the last picture (home page), the navigation bar remains. When the user clicks "Finish" on the first image, I use self.performSegueWithIdentifier("loginTrue", sender: nil) to go to the "home page". I tried using

self.presentingViewController?.dismissViewControllerAnimated(true, completion: nil)

But nothing happens. So, to wrap it all up, any idea on how I can β€œreject” the navigation controller from the β€œhome page”? Thank!

+4
source share
4 answers

Try

self.navigationController?.popViewControllerAnimated(true)
+12

ViewController LoginView. self.dismissViewControllerAnimated PerformSegue NavigationController.

+1

Is registration submission manager presented modally? Then, when registering the view controller, you can do

self.dismissViewControllerAnimated(true, completion: nil) 
0
source
//hide the navigation bar on this page
override func viewWillAppear(_ animated: Bool) {
    self.navigationController?.isNavigationBarHidden = true
}

This will hide the navigation bar on your home page, but make sure you use viewWillAppear, so whenever you return to the page, the navigation does not appear again.

0
source

All Articles