JVS JVS - 1 year ago 93
Swift Question

Back Bar Button Segue hides Toolbar

I am using a

segue in my application.
Whenever I segue to another screen and press the back bar button, my

I tried to get rid of it with

navigationController?.toolbar.hidden = false

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

Answer Source

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

 override func viewWillAppear(animated: Bool) {
    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.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download