How to hide large title iOS 11 search controller

Viewed 2547

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 Answers

Sorry for a late reply, but try the following

navigationItem.titleView = searchController.searchBar

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

Related