Skip to content

Instantly share code, notes, and snippets.

@MosheBerman
Created March 20, 2017 01:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save MosheBerman/5a9fafa02785add5b4842a0e079860dc to your computer and use it in GitHub Desktop.
Save MosheBerman/5a9fafa02785add5b4842a0e079860dc to your computer and use it in GitHub Desktop.
Set the Status Bar Color on iOS...
func setStatusBarColor(color: UIColor) {
let statusBarWindow = UIApplication.sharedApplication().valueForKey("statusBarWindow")
let statusBar = statusBarWindow!.valueForKey("statusBar")
let selector = Selector("setForegroundColor:")
if statusBar!.respondsToSelector(selector) {
statusBar!.performSelector(selector, withObject: color)
}
}
@MosheBerman
Copy link
Author

Fond this in an email from a dev named Josh Siegel.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment