title: Check the iOS status bar hidden with a modal view controller
body: <p>so i'm using the "Utility Application" template in Xcode and have the <strong>Main View Controller</strong>, where the user can hide and show the status bar using a button. I've also got the <strong>Flipside View Controller</strong>, using a modal segue, which has a done button to return to the <strong>Main VC</strong>. I've set it up so that whenever viewing the <strong>Flipside VC</strong>, the status bar is always NOT hidden. This means that if the user hides the status bar on the <strong>Main VC</strong> and transitions to the <strong>Flipside VC</strong>, it will animate on and if the user didn't hide the status bar and they transition, nothing happens to the status bar.</p>
  
  <p>That's all good, the problem is transitioning back from the <strong>Flipside VC</strong> to <strong>Main VC</strong>. I need a condition to check the hidden state of the status bar in the <strong>Main VC</strong>, which would be called in the <strong>Flipside VC</strong> when pressing the done button.</p>
  
  <p>I've looked into using a BOOL as well as NSNotificationCenter to send a message to the <strong>Flipside VC</strong> about the state of the status bar.</p>
  
  <p>I had this code:</p>
  
  <pre><code>-(BOOL)checkStatusBarHidden:(id)input
  {
      BOOL result;
  
      if ([UIApplication sharedApplication].statusBarHidden = YES)
      {
          result = YES;
      }
      else
      {
          result = NO;
      }
  
      return result;
  }
  </code></pre>
  
  <p>But this is all just guessing and thinking I might be able to use it somewhere to inform the <strong>Flipside VC</strong> of the status bar state. I thought of maybe changing the</p>
  
  <pre><code>[UIApplication sharedApplication].statusBarHidden = YES)
  </code></pre>
  
  <p>to something like</p>
  
  <pre><code>self.statusBarHidden = YES //which of course isn't going to work
  </code></pre>
  
  <p>But anyway, as I said it's guessing and i'm not sure what to do.</p>