I have a UISearchController
which I present programmatically when the user touches a button. My problem is that the search bar overlaps the status (see screenshot)
I have the following code which I use to present the UISearchController
func presentSearchController() {
let resultsController = ResultsViewController()
self.searchController = UISearchController(searchResultsController: resultsController)
self.searchController.searchBar.searchBarStyle = .prominent
searchController.hidesNavigationBarDuringPresentation = false
searchController.searchResultsUpdater = resultsController
self.definesPresentationContext = true
self.present(self.searchController, animated: true, completion: nil)
}
Edit: My question is not a duplicate of UISearchBar overlaps status bar in iOS as I am not working directly with the searchbar or it's frame