title: iOS - UINavigationController, Hide navigationBar
body: <p>I have a minor trouble hiding the navigationBar for my UINavigationController</p>
  
  <p>I have added:</p>
  
  <pre><code>self.navigation!.navigationBar.hidden = true
  </code></pre>
  
  <p>This, unfortunately leaves some kind of background (white) left behind the white status bar that pushes the content (green) downwards, and an unwanted scroll behaviour where I can drag the content up and down to show/hide the white background. What I need is for the statusbar to take up no vertical space what so ever and lay on top of the content (green) </p>
  
  <p>How do I achieve this? 
  Answers in swift as well obj-c are very welcome </p>
  
  <p><img src="https://i.stack.imgur.com/RXG9e.jpg" alt="enter image description here">
  <strong>EDIT:</strong>
  I have tried various versions of the following, the problem remains -.-</p>
  
  <pre><code>override func loadView() {
      self.view = UIView(frame:UIScreen.mainScreen().bounds)
      self.view.backgroundColor = UIColor.whiteColor()
  
  
      self.navigation = UINavigationController(rootViewController: self.guideViewController!)
  
      self.navigation!.navigationBarHidden = true
      self.navigation!.setNavigationBarHidden(true, animated: true)
  
      self.view.addSubview(self.navigation!.view)
  }
  
  override func viewDidLoad() {
      self.automaticallyAdjustsScrollViewInsets = false
      self.navigation!.automaticallyAdjustsScrollViewInsets = false
  }
  </code></pre>
  
  <p><strong>EDIT 2:</strong></p>
  
  <p>printing:</p>
  
  <pre><code>UIApplication.sharedApplication().statusBarFrame.size.height
  </code></pre>
  
  <p>after viewDidLoad returns 20</p>