title: UISearchBar displayed on top of Overlay
body: <p>My App has a <code>UITableView</code> with a <code>UISearchController</code> in the table view header.<br>
  Tapping on a table cell shows a dialog / overlay.  Overlay is a <code>UIVisualEffectView</code>. </p>
  
  <p><strong>Issue:</strong> The search bar is displaying over the overlay as shown.<br>
  <a href="https://i.stack.imgur.com/v32gG.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/v32gG.png" alt="enter image description here"></a></p>
  
  <p>I am setting <code>definesPresentationContext = true</code> on my view controller, and the code for setting up my UISearchController is the following...</p>
  
  <pre><code>lazy var resultSearchController: UISearchController = ({
    let controller = UISearchController(searchResultsController: nil)
    controller.searchResultsUpdater = self
    controller.dimsBackgroundDuringPresentation = false
    controller.searchBar.sizeToFit()
    controller.hidesNavigationBarDuringPresentation = false
    controller.searchBar.delegate = self
    return controller
  })()
  </code></pre>
  
  <p>After setting <code>hidden</code> to false on the overlay.  I bring it to the front like so...</p>
  
  <pre><code>welcomeLabel.text = user!.fullName.isEmpty ? "Hello, \(user!.name)" : "Hello, \(user!.fullName)"
  self.view.bringSubviewToFront(loginBackground)
  self.view.bringSubviewToFront(loginContainer)
  </code></pre>
  
  <p>This issue arises only when the search bar is active.  Anyone know of a workaround?</p>
  
  <p>Thanks!</p>