title: Create a custom UINavigationcontroller class
body: <p>I have done the following customisation to my embedded UINavigationcontroller. I've done this in the view controller of the view that will show up as first.</p>
  
  <p>However I'm trying to clean it up so that I don't have this all in my UIView class by creating a separate class that will take care of this. The code I'm currently using</p>
  
  <pre><code>self.navigationController?.navigationBar.setBackgroundImage(UIImage(named: "navigation.background"), for: .default)
  
  let backButton = UIImage(named: "Back.button")?.withRenderingMode(.alwaysOriginal)
  let backButtonHigh = UIImage(named: "Back.button.highlighted")?.withRenderingMode(.alwaysOriginal)
  
  
  self.navigationController?.navigationBar.backIndicatorImage = backButton
  self.navigationController?.navigationBar.backIndicatorTransitionMaskImage = backButtonHigh
  self.navigationItem.backBarButtonItem = UIBarButtonItem(title: "", style: .plain, target: nil, action: nil)
  </code></pre>
  
  <p>What I've tried to do is extend the UInavigationcontroller in a new class like this</p>
  
  <pre><code>class RSRNavigationController: UINavigationController{
      override func viewDidLoad() {
          super.viewDidLoad()
  
  self.navigationController?.navigationBar.setBackgroundImage(UIImage(named: "navigation.background"), for: .default)
  
  let backButton = UIImage(named: "Back.button")?.withRenderingMode(.alwaysOriginal)
  let backButtonHigh = UIImage(named: "Back.button.highlighted")?.withRenderingMode(.alwaysOriginal)
  
  self.navigationController?.navigationBar.backIndicatorImage = backButton
  self.navigationController?.navigationBar.backIndicatorTransitionMaskImage = backButtonHigh
  self.navigationItem.backBarButtonItem = UIBarButtonItem(title: "", style: .plain, target: nil, action: nil)
      }
  }
  </code></pre>
  
  <p>this doesn't work. It will run without problems but it won't actually do anything.</p>
  
  <p>I've also tried to do the following</p>
  
  <pre><code>class RSRNavigationController: UINavigationBar{
      override func draw(_ rect: CGRect) {
          super.draw(rect)
          self.setBackgroundImage(UIImage(named: "navigation.background"), for: .default)
          let backButton = UIImage(named: "Back.button")?.withRenderingMode(.alwaysOriginal)
          let backButtonHigh = UIImage(named: "Back.button.highlighted")?.withRenderingMode(.alwaysOriginal)
          self.backIndicatorImage = backButton
          self.backIndicatorTransitionMaskImage = backButtonHigh
          //self.backItem = UIBarButtonItem(title: "", style: .plain, target: nil, action: nil)
      }
  </code></pre>
  
  <p>However I can't seem to set the title for the back button. </p>
  
  <p>Does anyone know how to fix this?</p>