Placing a UISearchBar in the titleView navigation bar, you can prevent it from scrolling when scrolling through the table.
self.searchController.hidesNavigationBarDuringPresentation = NO; self.searchController.searchBar.searchBarStyle = UISearchBarStyleMinimal;
UISearchController relies on searchResultsController , which should be a view controller that manages search results. Ensure that the view manager searchResultsController to the text-based searchResultsController property updates in the UISearchBar when the UISearchController active. That way you can use the UISearchController with a tableview or collectionview view.
source share