How to hide large title iOS 11 search controller

2.6k Views Asked by At

I have set the search controller of my navigation item, so that the search bar is positioned at the top of the screen. What I want to happen is that the search bar is in the 'title view' position like what used to happen on iOS 10. However, the search bar is moved down to make space for a large title for the view controller. How can I hide this extra space?

navigationItem.searchController = searchController
1

There are 1 best solutions below

0
On

Sorry for a late reply, but try the following

navigationItem.titleView = searchController.searchBar

instead of navigationItem.searchController = searchController. Hope it will help!