title: Swift: Change status bar color for iOS 13
body: <p>For ios 13 I can't set text color of the status bar. How I can get the view of statusBarManager? How I can change the text color only?</p>
  
  <p>due to:</p>
  
  <blockquote>
    <p>Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'App called -statusBar or -statusBarWindow on UIApplication: this code must be changed as there's no longer a status bar or status bar window. Use the statusBarManager object on the window scene instead.'</p>
  </blockquote>
  
  <p>My current code:</p>
  
  <pre class="lang-swift prettyprint-override"><code>    func setStatusBarTextColor(_ color: UIColor) {
          if #available(iOS 13.0, *) {
              // How to do for iOS 13??
          } else {
              if let statusBar = UIApplication.shared.value(forKey: "statusBar") as? UIView {
                  statusBar.setValue(color, forKey: "foregroundColor")
              }
          }
      }
  </code></pre>
  
  <p>I have already found this <a href="https://stackoverflow.com/a/57394751/9172697">https://stackoverflow.com/a/57394751/9172697</a> but it's not what i looking for</p>