I am using this code with no problem, but I would like to place the search controller below the navigation item’s titleView, instead of replacing it. With iOS11 it’s as easy as setting navigationItem.searchController to the searchController, and it will place it below the titleView, but in the navigationItem.
Any ideas on how to do this prior to iOS 11, instead of replacing the titleView?
Current Code:
if #available(iOS 11, *) {
navigationItem.searchController = searchController
navigationItem.hidesSearchBarWhenScrolling = false
} else {
navigationItem.titleView = searchController.searchBar
}