title: How to make search bar not scrolling along with table view?
body: <p>I want to make a search bar like this.</p>
  
  <p><a href="https://i.stack.imgur.com/jpZKo.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/jpZKo.jpg" alt="enter image description here"></a></p>
  
  <p>The search bar in contacts app is stay while I scroll down. I want to make a search bar with this property that <strong>It doesn't scroll down along with table view</strong> . I did my app in table view controller.This is my code in my table view controller.</p>
  
  <p>myTableViewController(in my viewDidLoad function):</p>
  
  <pre><code>searchController = UISearchController(searchResultsController: nil)
  searchController.hidesNavigationBarDuringPresentation = false
  searchController.searchBar.searchBarStyle = UISearchBarStyle.Prominent
  searchController.searchBar.sizeToFit()
  tableView.tableHeaderView = searchController.searchBar
  definesPresentationContext = true
  searchController.searchResultsUpdater = self
  searchController.dimsBackgroundDuringPresentation = false
  </code></pre>
  
  <p>It should work like search bar in contact because of this code</p>
  
  <pre><code>tableView.tableHeaderView = searchController.searchBar
  </code></pre>
  
  <p>Is there something i do wrong? If not then how to make my search bar doesn't scroll down with table view(in table view controller)?</p>