title: swift: change the color of the navigation bar
body: <p>I am using a <code>FirstViewController</code> with a red tint color navigation bar. When I go to next <code>SecondViewController</code> I use this code that clear navigation bar color:</p>
  <pre><code>self.navigationController?.navigationBar.setBackgroundImage(UIImage(), for: .default)
  </code></pre>
  <p>But when I go back to <code>FirstViewController</code> my navigation bar color is not red. It is clear. But it should be red. How to fix it?</p>
  <p>code in <code>FirstViewController</code>:</p>
  <pre><code>override func viewWillAppear(_ animated: Bool) {
          super.viewWillAppear(animated)
  
          self.navigationController?.navigationBar.prefersLargeTitles = true
          self.navigationItem.largeTitleDisplayMode = .always
          self.navigationController?.navigationBar.shadowImage = UIImage()
          
          self.navigationController?.navigationBar.barTintColor = UIColor(red: 239/255, green: 210/255, blue: 166/255, alpha: 1.0)
      }
  </code></pre>