Search code examples
iosuistatusbar

Get the current color of the status bar


Is it possible to get the current color of the status bar in iOS? I know we can change the color but is it possible to programmatically get the current state of the status bar? e.g whether its UIStatusBarStyleLightContent or UIStatusBarStyleDefault


Solution

  • You can get it like this:

    UIStatusBarStyle currentStyle = [UIApplication sharedAppplication].statusBarStyle;