title: Add UISearchBar to UINavigationBar with UIBarButtonItem
body: <p>In my app, I used to have a search bar in the header view of my table view. However, I have added a search bar button item, and when a user taps it, I want a search bar to animate across the navigation bar, and the user should be able to search. This is kind of like the search bar in the Twitter iOS app. here is the code for my UISearchController:</p>
  
  <pre><code>self.searchController = ({
          let controller = UISearchController(searchResultsController: nil)
          controller.searchResultsUpdater = self
          controller.hidesNavigationBarDuringPresentation = true
          controller.dimsBackgroundDuringPresentation = false
          controller.searchBar.sizeToFit()
          //self.tableView.tableHeaderView = controller.searchBar
          self.definesPresentationContext = true
          controller.searchBar.returnKeyType = .Search
          controller.searchBar.delegate = self
  
          return controller
  
      })()
  </code></pre>
  
  <p>Here is how my UINavigationBar looks like right now: <a href="https://i.stack.imgur.com/i9J1D.png" rel="noreferrer"><img src="https://i.stack.imgur.com/i9J1D.png" alt="enter image description here"></a></p>
  
  <p>How would I go about doing this?</p>