title: How to hide navigation bar immediately in Swift?
body: <p>My UIViewController is embed in a navigation controller: </p>
  
  <p><a href="https://i.stack.imgur.com/X4urt.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/X4urt.png" alt="enter image description here"></a></p>
  
  <p>I tried <a href="https://developer.apple.com/library/ios/documentation/UIKit/Reference/UINavigationController_Class/index.html#//apple_ref/occ/instm/UINavigationController/setNavigationBarHidden:animated:" rel="nofollow noreferrer">setNavigationBarHidden:animated:</a> to hide notificationbar. It works but there are about 2 seconds delay. Here is the screenshot: </p>
  
  <p><a href="https://i.stack.imgur.com/E9uc8.gif" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/E9uc8.gif" alt="enter image description here"></a></p>
  
  <p>My usage is to add it in <code>viewDidLoad()</code>: </p>
  
  <pre><code>override func viewDidLoad() {
      super.viewDidLoad()
      self.navigationController?.setNavigationBarHidden(true, animated: false)
  }
  </code></pre>
  
  <p>How to hide <code>navigationbar</code> immediately when screen is launched ?</p>