title: custom background image with large titles NavigationBar in iOS 11
body: <p>How do you set a custom background image for the large title NavigationBar in iOS 11? I'm using a custom subclass which I've assigned to the navigationControllers in the storyboard.</p>
  
  <p>This is how I create my custom NavBar:</p>
  
  <pre><code>class CustomNavigationController: UINavigationController {
  
      override func viewDidLoad() {
          super.viewDidLoad()
  
          // Do any additional setup after loading the view.
          self.navigationBar.tintColor = UIColor(red:1, green:1, blue:1, alpha:0.6)
          self.navigationBar.titleTextAttributes = [NSForegroundColorAttributeName: UIColor.white]
          if #available(iOS 11.0, *) {
              self.navigationBar.prefersLargeTitles = true
              self.navigationItem.largeTitleDisplayMode = .automatic
              self.navigationBar.largeTitleTextAttributes = [NSForegroundColorAttributeName: UIColor.white]
              self.navigationBar.barTintColor = UIColor.green
          }
          self.navigationBar.isTranslucent = false
          self.navigationBar.setBackgroundImage(#imageLiteral(resourceName: "navigationBarBackground"), for: .default)
          self.navigationBar.shadowImage = #imageLiteral(resourceName: "navigationBarShadow")
      }
  }
  </code></pre>
  
  <p>Strangely the <code>setBackgroundImage(image, for: .default)</code> doesn't work for the large titles. It worked before with iOS 10 and also if I rotate the iPhone (and activate the small NavBar) the background is back?</p>
  
  <p><strong>Edit:</strong>
  The <code>backgroundImage</code> is still rendered but somehow hidden. Only if you start scrolling and the "normal" Navigation Bar appears, the backgroundImage is visible. Also the <code>barTintColor</code> is completely ignored in this case.
  <a href="https://i.stack.imgur.com/qtA8S.png" rel="noreferrer"><img src="https://i.stack.imgur.com/qtA8S.png" alt="screenshot"></a>
  <a href="https://i.stack.imgur.com/YGrPh.gif" rel="noreferrer"><img src="https://i.stack.imgur.com/YGrPh.gif" alt="GIF"></a></p>