0

I have two UITableViewController, and in each of them NavigationBar is visible; then I have a simple UIViewController. So I'd like to make NavigationBar invisible only in the third view. I tried

self.navigationController?.navigationBarHidden = true

but this make navigationBar invisibile in every view, after I leave the third one.

I also tried

override func prefersStatusBarHidden() -> Bool {
    return true
}

This is my application scheme: only in "DettaglioController" I'd like to make navigationBar invisible.

enter image description here

Any ideas to solve?

Community
  • 1
  • 1
Fabio Cenni
  • 841
  • 3
  • 16
  • 30

1 Answers1

2

Its just one line of code....

navigationController?.setNavigationBarHidden(true, animated: true)

In the ViewControllers viewWillAppear you can hide the NavigationBar like this, and in its viewWillDisappear you can show it back again

Dennis Weidmann
  • 1,942
  • 1
  • 14
  • 16
  • You can choose where to put it... try out the viewWillAppear and viewDidAppear, and viewWillDisappear and viewDidDisappear until you have it showing and hiding the way you want – Dennis Weidmann Aug 25 '15 at 16:48