title: How do I display a UISearchController on a UINavigationItem without an underlying UIScrollView?
body: <p>Maybe this is impossible, but I always assumed you could just throw a <code>UISearchController</code> instance onto any old view controller's <code>navigationItem</code> and get a search bar. It seems to me like no matter what I try, I can't get it to work. It's making me think this behavior is hardcoded to only work when the view controller's <code>view</code> property is a subclass of <code>UIScrollView</code>.</p>
  
  <p>I hope this is just a red herring. If I missed something obvious, please help! This is infuriating.</p>
  
  <p>Here's what I did:</p>
  
  <pre><code>import UIKit.UIViewController
  
  class MainViewController: UIViewController {
  
      override func viewDidLoad() {
          super.viewDidLoad()
  
          navigationItem.hidesSearchBarWhenScrolling = false
  
          navigationItem.searchController = {
              let searchController = UISearchController()
              searchController.hidesNavigationBarDuringPresentation = false
              searchController.dimsBackgroundDuringPresentation = false
              searchController.obscuresBackgroundDuringPresentation = false
              return searchController
          }()
      }
  }
  </code></pre>
  
  <p>No search bar ever appears on screen. It just looks like a regular old navigation bar.</p>