title: How we can set the Light Content style of Status Bar in iOS 9 for whole application?
body: <p>I want to apply Light Content style to the whole application.</p>
  
  <p>Following method is deprecated in iOS 9 without the replacement method.</p>
  
  <blockquote>
    <p>-setStatusBarStyle:animated:</p>
    
    <p>Sets the style of the status bar, optionally animating the transition
    to the new style.</p>
  </blockquote>
  
  <p>Is working in the <code>AppDelegate</code> like as :</p>
  
  <p><em>Swift 1.2 Code :</em>  </p>
  
  <pre><code>UIApplication.sharedApplication().setStatusBarStyle(UIStatusBarStyle.LightContent, animated: true)
  </code></pre>
  
  <p>But when I upgrade my project to iOS 9/Swift 2 they are giving me warning message about : </p>
  
  <pre><code>&lt;Error&gt;: CGContextSaveGState: invalid context 0x0. If you want to see the backtrace, please set CG_CONTEXT_SHOW_BACKTRACE environmental variable.
  &lt;Error&gt;: CGContextTranslateCTM: invalid context 0x0. If you want to see the backtrace, please set CG_CONTEXT_SHOW_BACKTRACE environmental variable.
  &lt;Error&gt;: CGContextRestoreGState: invalid context 0x0. If you want to see the backtrace, please set CG_CONTEXT_SHOW_BACKTRACE environmental variable.
  </code></pre>
  
  <p>So as per the solution from the <a href="https://forums.developer.apple.com/thread/13683" rel="nofollow noreferrer">apple forum</a> and from this answer <a href="https://stackoverflow.com/questions/32236204/cgcontextsavegstate-invalid-context-0x0-error-only-on-device">CGContextSaveGState: invalid context 0x0 Error only on device</a> </p>
  
  <p>So, I have removed the property <code>UIViewControllerBasedStatusBarAppearance</code> from the <code>info.plist</code> file as per the solution.</p>
  
  <p>Now the situation is that <strong>How we can set the Light Content style of Status Bar in iOS 9 for whole application?</strong> </p>
  
  <p>From the forum : </p>
  
  <p><a href="https://i.stack.imgur.com/VsB1s.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/VsB1s.png" alt="enter image description here"></a></p>
  
  <p>I don't want to set the Light Content for each and every view.</p>
  
  <p>Any suggestions?</p>
  
  <p>Objective-C should have the same issue.</p>