hello I have ControllerA in which I am hiding a NavigationBar
. On the ControllerB I am showing the NavigationBar
. On the ControllerB I have implemented a searchBar with TableView
. So when user selects any row I am dismissing the controller. Problem is It shows navigationBar on controllerA.
This is how I am first hiding the NavigationBar in ControllerA
ControllerA
override func viewWillAppear(animated: Bool) {
super.viewWillAppear(animated);
self.navigationController?.setNavigationBarHidden(true, animated: true)
}
ControllerB here I am showing it
override func viewWillAppear(animated: Bool) {
super.viewWillAppear(animated);
self.navigationController?.setNavigationBarHidden(false, animated: true)
}
override func tableView(tableView: UITableView, didSelectRowAtIndexPath indexPath: NSIndexPath) {
self.navigationController!.popViewControllerAnimated(true)
}
What I have tried is I try to put hidden navigation Code in viewWillDisappear
function in ControllerB but it doesn't work. It hides the bar in some delay after showing it.
I also tried to put in the viewDidLoad
function of ControllerA, But still it shows the bar
Please tell me how can I hide the navigationBar on ControllerA after ControllerB get dismissed