title: Same background image for all view controllers in Swift
body: <p>I would like to set the same background image for all of the view controllers. Here is what I've tried:</p>
  
  <pre><code>let backgroundImage = UIImageView(frame: UIScreen.main.bounds)
  backgroundImage.image = UIImage(named: "bg_name.png")
  backgroundImage.contentMode = UIViewContentMode.scaleAspectFill
  self.view.insertSubview(backgroundImage, at: 0)
  </code></pre>
  
  <p>But that only works by copy-pasting it everywhere. What's a better way to do this?</p>