title: Setting statusbarStyle (deprecated in iOS 9.0)
body: <p>Just downloaded the new xCode 10.0 and saw that the old statusBarStyle has been deprecated since iOS 9.0.</p>
  <p><strong>Warning:</strong> <code>Setter for 'statusBarStyle' was deprecated in iOS 9.0: Use -[UIViewController preferredStatusBarStyle]</code></p>
  <p><strong>Deprecated code:</strong>
  <code>UIApplication.shared.statusBarStyle = .default</code></p>
  <p>I tried using <code>self.preferredStatusBarStyle</code>, but found out the property is only a getter. So anyone knows how to set the <code>statusBarStyle</code>?</p>
  <br>
  <h2>Edit</h2>
  <p>I want to change the statusBarStyle inside a function, where a user can switch between different themes. For example:</p>
  <pre><code>func changeStatusBar(toDarkMode: Bool) {
      if toDarkMode {
          // Set to light statusBarStyle
      } else { 
          // Set to default
      }
  }
  </code></pre>