title: Swift 3: How to reverse a transparent Navigation Bar?
body: <p>I'm trying to create a twitter app, emulating the real app, using the twitter API. On the timeline view, I have a regular navigation bar, and when a user taps a user profile, the profile view has a transparent bar so that the user's banner image can be displayed. I used the following code to make the navigation bar transparent in the user profile view:</p>
  
  <pre><code>self.navigationController?.navigationBar.setBackgroundImage(UIImage(), for: .default)
  self.navigationController?.navigationBar.shadowImage = UIImage()
  self.navigationController?.navigationBar.isTranslucent = true
  </code></pre>
  
  <p>The problem I'm having is when I return from the profile view, the timeline navigation bar has become messed up (screenshots below). I'm guessing this is because I changed some aspects of the navigation bar in the view controller for the profile view, and that carried over when I returned to the timeline view. </p>
  
  <p>How can I reverse the navigation bar transparency to fix the wonky navigation bar? In the timeline view controller I've tried using the following code to try to reverse it, but it doesn't work. </p>
  
  <pre><code>self.navigationController?.navigationBar.setBackgroundImage(nil, for: .default)
  self.navigationController?.navigationBar.shadowImage = nil
  self.navigationController?.navigationBar.isTranslucent = false
  </code></pre>
  
  <p><strong>Timeline view with regular navigation bar</strong></p>
  
  <p><a href="https://i.stack.imgur.com/nPX9R.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/nPX9R.png" alt="Timeline view with regular navigation bar"></a></p>
  
  <p><strong>Profile view with transparent navigation bar</strong></p>
  
  <p><a href="https://i.stack.imgur.com/nPX9R.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/vROoG.png" alt="Profile view with transparent navigation bar"></a></p>
  
  <p><strong>Timeline view with wonky navigation bar after returning from profile view</strong></p>
  
  <p><a href="https://i.stack.imgur.com/iZOzT.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/iZOzT.png" alt="Timeline view with wonky navigation bar after returning from profile view"></a></p>