Preventing UISearchController from hiding navigation bar in IOS8
I have a UIViewController embedded in a popover. This controller has two subrequests, UINavigationBar and UITableView. I am trying to implement a new search API (as SearchDisplayControlled is deprecated in iOS8).
When I click on the search bar (two areas are displayed) everything is fine and the navigation bar is still visible. But when I type in the search bar, the navigation bar disappears, replaced with an empty area. I tried adding self.searchController.hidesNavigationBarDuringPresentation = NO;
to the method updateSearchResultsForSearchController:
but didn't get any result. (note the controller viewDidLoad defines self.definesPresentationContext = YES;
)
Any idea to make the navigation appear at any time?
source to share
I saw the same effect - in my case, by setting the property in viewDidLoad
, in my view, the controller made the navigation bar circular:
- (void)viewDidLoad {
...
self.definesPresentationContext = YES;
...
}
When I previously set the same property from the class that handled the search (initialized after it -viewDidLoad
was already called in VC), I saw the same behavior of the empty nav bar you describe.
source to share