title: UIStatusBar Appearance with Multiple Windows
body: <p>First, my app's setup:</p>
  
  <p>Most of the app's view controllers exist in your standard navigation controller hierarchy, but I also have a second window over the main app window, which hosts a view controller (<code>NotificationVC</code>). If <code>NotificationVC</code> is presenting a notification, it will change the status bar style to contrast with the notifications, but otherwise it defers the style to the main window's root view controller.</p>
  
  <p>My issue is that changes in the main window that would <em>normally</em> trigger a status bar appearance update (pushing, popping or presenting a view controller, or calling <code>-[UIViewController setNeedsStatusBarAppearanceUpdate]</code>) <strong>have no effect</strong>.</p>
  
  <p>Here's the relevant code from <code>NotificationVC</code>:</p>
  
  <pre><code>@implementation NotificationVC
  
  - (UIStatusBarStyle)preferredStatusBarStyle
  {
      if (self.isShowingNotification)
      {
          if (self.notificationView.hasDarkBackground)
          {
              return UIStatusBarStyleLightContent;
          }
          else
          {
              return UIStatusBarStyleDefault;
          }
      }
      else
      {
          return [[UIApplication sharedApplication].delegate window].rootViewController.preferredStatusBarStyle;
      }
  }
  
  @end
  </code></pre>
  
  <p>How can I get the status bar to update from one of the view controllers in the main window?</p>
  
  <p><em>Note: Manually setting the status bar appearance (<code>-[UIApplication setStatusBarStyle:]</code>) is not an acceptable solution for this app.</em></p>