title: How to hide status bar on a view
body: <p>Before someone marks it duplicate, I want to say that I've seen all those answers and none helps me. Also they are donkey years old solution which don't work anymore.</p>
  
  <p>I want to hide status bar only on a view. </p>
  
  <pre><code>Info.plist settings:
  Status bar style: Light Content
  View controller-based status bar appearance: NO
  </code></pre>
  
  <p>With above settings I've tried many solutions but none worked. The only way I could get it to work is following</p>
  
  <pre><code>override func viewWillAppear(_ animated: Bool) {
      super.viewWillAppear(animated)
      // Hide status bar - this is the only working solution for me
      // Setter for 'isStatusBarHidden' was deprecated in iOS 9.0: Use -[UIViewController prefersStatusBarHidden]
      UIApplication.shared.isStatusBarHidden = true
  }
  </code></pre>
  
  <p>However this working solution gives warning in Xcode</p>
  
  <pre><code>// Setter for 'isStatusBarHidden' was deprecated in iOS 9.0: Use -[UIViewController prefersStatusBarHidden]
  </code></pre>
  
  <p>The solution for above warning is to use those workarounds which again don't work.</p>
  
  <p>Is there any simple and definite way to hide status bar on a view?</p>