title: How to remove shadow below UINavigationBar with UISearchController
body: <p><a href="https://i.stack.imgur.com/kSYix.png" rel="noreferrer"><img src="https://i.stack.imgur.com/kSYix.png" alt="Image 1"></a></p>
  
  <p>I could successfully remove the shadow below the navigation bar with the following line of code.</p>
  
  <pre><code>self.navigationController?.navigationBar.shadowImage = UIImage()
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/7vmJJ.png" rel="noreferrer"><img src="https://i.stack.imgur.com/7vmJJ.png" alt="Image 2"></a></p>
  
  <p>When I added a search controller however, the shadow reappeared.</p>
  
  <pre><code>self.navigationItem.searchController = UISearchController(searchResultsController: nil)
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/FSX3N.png" rel="noreferrer"><img src="https://i.stack.imgur.com/FSX3N.png" alt="Image 3"></a></p>
  
  <p>I tried the following, but resulted an unexpected behavior.</p>
  
  <pre><code>self.navigationController?.navigationBar.setBackgroundImage(UIImage(), for: .default)
  self.navigationController?.navigationBar.barTintColor = .white
  self.navigationController?.navigationBar.isTranslucent = false
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/dLirR.png" rel="noreferrer"><img src="https://i.stack.imgur.com/dLirR.png" alt="Image 4"></a></p>
  
  <p>How do I remove the shadow under a navigation bar when there is a search controller attached?</p>