title: Presenting UISearchController overlaps with statusbar
body: <p>I have a <code>UISearchController</code> which I present programmatically when the user touches a button. My problem is that the search bar overlaps the status (see screenshot)</p>
  
  <p><a href="https://i.stack.imgur.com/mPfBJ.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/mPfBJ.png" alt="enter image description here"></a></p>
  
  <p>I have the following code which I use to present the <code>UISearchController</code></p>
  
  <pre><code>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)
  }
  </code></pre>
  
  <p>Edit: My question is not a duplicate of <a href="https://stackoverflow.com/questions/18975920">UISearchBar overlaps status bar in iOS</a> as I am not working directly with the searchbar or it's frame</p>