title: Swift iOS 15: Status bar shows incorrect style when launching the app
body: <p>My app uses a Navigation controller as the initial View Controller. Please see the screenshot attached</p>
  <p><a href="https://i.stack.imgur.com/HzMhM.png" rel="nofollow noreferrer">Main</a></p>
  <p>In the first view controller, embedded in the navigation controller, I use the view did load method to set the navigation bar style as follows:</p>
  <pre><code>navigationController?.navigationBar.overrideUserInterfaceStyle = .dark
  navigationController?.navigationBar.barStyle = .black
  let appearance = UINavigationBarAppearance()
  appearance.configureWithTransparentBackground()
  navigationController?.navigationBar.standardAppearance = appearance
  navigationController?.navigationBar.scrollEdgeAppearance = appearance 
  </code></pre>
  <p>The above 2 lines of codes, combined with the setting: <code>View controller-based status bar appearance</code> set to YES in the Info.plist allows me to successfully customize my status bar color as well as changing bar color when the user clicks on a specific button. Meaning that when the user clicks on a button on the same view controller, I can successfully change the status bar color settings to:</p>
  <pre><code>navigationController?.navigationBar.overrideUserInterfaceStyle = .light
  navigationController?.navigationBar.barStyle = .default
  </code></pre>
  <p>Everything works as expected except when launching the app for the first time. When I kill the app and start it, the status bar color will be default instead of black. I have no idea why, it only happens when launching the app for the first time. Please see GIFs attached for example.</p>
  <ul>
  <li>When starting the app, the status bar has a default style</li>
  <li>When navigating away from the app, then back to it, the status bar has the correct style: .black</li>
  </ul>
  <p>Im only facing this issue on the first screen of the app, the rest works just has expected. Wondering if anyone has an idea of whats going on here... Thanks in advance for your time!</p>
  <p><a href="https://i.stack.imgur.com/phECm.gif" rel="nofollow noreferrer">Demo GIF</a></p>