Created
March 20, 2017 01:32
-
-
Save MosheBerman/5a9fafa02785add5b4842a0e079860dc to your computer and use it in GitHub Desktop.
Set the Status Bar Color on iOS...
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Fond this in an email from a dev named Josh Siegel.