I\'ve got an iPhone application with a UITableView
menu. When a row in the table is selected, the appropriate view controller is pushed onto the application\'s
Managing the toolbar state (i.e. which VC needs/doesn't need the toolbar) gets tricky quickly.
I've had success with following this rule:
For each view controller, in viewWillAppear()
, decide if it needs a toolbar or doesn't, then call navigationController?.setToolbarHidden(true or false, animated: animated)
respectively.
This way, each view controller starts out with the correct toolbar state and you don't have to worry about "restoring" the toolbar state when the view controller is dismissed.