2

I am using a Show segue in my application. Whenever I segue to another screen and press the back bar button, my navigationController.toolbar disappears.

I tried to get rid of it with

        navigationController?.toolbar.hidden = false

in my viewDidLoad(). It doesn't work though. Any ideas?

JVS
  • 2,592
  • 3
  • 19
  • 31

2 Answers2

1

navigationController?.toolbarHidden = false

Diogo Antunes
  • 2,241
  • 1
  • 22
  • 37
1

Please add the code in the viewWillAppear() and it should solve the problem you are facing.

 override func viewWillAppear(animated: Bool) {
    super.viewWillAppear(animated)
    navigationController?.toolbarHidden = false

}

Remember that viewDidLoad() fires only once during the life cycle of a view controller and in your case , it is in the navigation stack which means it has been already used for that view controller and now when you press back button, it does not work again.

Zeeshan Khan
  • 28
  • 2
  • 8