Search code examples
iphoneiphone-sdk-3.0uinavigationcontrolleruisearchdisplaycontroller

Prevent a UISearchDisplayController from hiding the navigation bar


Whenever a user begins editing a UISearchDisplayController's search bar, the search controller becomes active and hides the view's navigation bar while presenting the search table view. Is it possible to prevent a UISearchDisplayController from hiding the navigation bar without reimplementing it?


Solution

  • The new UISearchController class introduced with iOS 8 has a property hidesNavigationBarDuringPresentation which you can set to false if you want to keep the navigation bar visible (by default it will still be hidden).