title: iOS 13 nav bar not fitting to content
body: <p>I've encountered an issue with the nav bar in iOS 13 when making it transparent. I have a navigation bar that I show and hide when a view controller appears/disappears.</p>
  
  <p>When I pop the navigation controller and show the navigation bar again the background image and shadow image are not filling all of the nav bar's contents.</p>
  
  <p>As you can see from the image I have search bar in the navigation bar that is derived from a <code>UISearchController</code>. </p>
  
  <p>Here is the code for showing/hiding the nav bar:</p>
  
  <pre><code>extension UINavigationController {
      public func showTransparentNavigationBar() {
          navigationBar.setBackgroundImage(UIImage(), for: .default)
          navigationBar.shadowImage = UIImage()
      }
  
      public func hideTransparentNavigationBar() {
          navigationBar.setBackgroundImage(nil, for: .default)
          navigationBar.shadowImage = nil
      }
  }
  </code></pre>
  
  <p>These methods are being called on the <code>viewDidAppear</code> of the initial view controller and pushed view controller.</p>
  
  <p>How can I fix this issue?</p>
  
  <p><a href="https://i.stack.imgur.com/Taux0.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Taux0.png" alt="enter image description here"></a></p>