I have an application where I need the navigation bar on only the listing screen and not the detailed screen (in most cases). I can easily achieve this by hiding the navbar in the detail screen using
self.navigationController?.setNavigationBarHidden(true, animated: false) //Added in viewWillAppear
Optionally, the listing screen also allows the user to search on tapping a button.
When the user taps on the search button, I add a searchController to the navigation bar
self.navigationItem.searchController = mySearchController
At this point if I take the user to the detailed view, the navigation bar does not hide on the detailed view. I tried adding the code to hide the navbar in viewDidAppear: and it works but shows a strange transition from navbar to no-navbar.
How can I get the navigation bar to hide in the detailed view when the searchcontroller is set in the previous screen? Thanks