I have a UINavigationBar with a search button. The search button triggers a UISearchController:
self.navigationItem.titleView = self.searchController.searchBar
self.searchController.searchBar.becomeFirstResponder()
When a user selects a search result, a new ViewController is pushed. If the user then taps back they are presented with the old ViewController with the still active search results.
If they then tap Cancel to dismiss the UISearchController, the UINavigationBar now covers the content in the view. I think it may be my setting of self.definesPresentationContext
to true
in viewDidLoad
and false
when the next viewController is presented