Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Prevent UISearchController from hiding the navigation bar

Tags:

ios

ios8

When a UISearchController's search bar becomes active, it hides the view's navigation bar. I'd like to have the search bar active below the navigation bar.

In iOS 7 there was a good way to do this for UISearchDisplayController here: https://stackoverflow.com/a/12529945/3799720

But now in iOS 8 with UISearchController I can't figure out how to do this.

like image 699
MaxB Avatar asked Oct 10 '14 16:10

MaxB


2 Answers

This might have something to do with the UISearchController hidesNavigationBarDuringPresentation property.

like image 74
matt Avatar answered Oct 23 '22 21:10

matt


yourSearchController.hidesNavigationBarDuringPresentation = false

this works in swift

like image 2
Boris Nikolic Avatar answered Oct 23 '22 20:10

Boris Nikolic