I would like to set the color of the font of the status bar displaying the time and battery percentage to a custom color other than the enumerations .default
and .lightContent
UIStatusBar Documentation.
Is this possible?
Asked
Active
Viewed 57 times
0

TheRedCamaro3.0 3.0
- 781
- 6
- 26
-
Possible duplicate of [set custom color of status bar in swift?](https://stackoverflow.com/questions/47172368/set-custom-color-of-status-bar-in-swift) – ielyamani Aug 28 '18 at 21:55
-
@Carpsen90 I appreciate your concern however that question deals with the color of the bar the super view underlying the time and battery percentage. I would like to change the color of the font not the bar to a custom color other than the enumerations offered by apple `.default` and `.lightContent`. https://developer.apple.com/documentation/uikit/uistatusbarstyle – TheRedCamaro3.0 3.0 Aug 28 '18 at 22:02
-
Could you please check the answers there? AFAIK the answer to your question is no. – ielyamani Aug 28 '18 at 22:03
-
@Carpsen90 I appreciate your help. I have checked and as I mentioned before that question deals with setting the background color of the `UIStatusBar` which is the underlying view. I would like to change the color of the font which is contained on the StatusBar to a custom color other than `.default` and `.lightContent`. – TheRedCamaro3.0 3.0 Aug 28 '18 at 22:07
1 Answers
0
For a production application I don't think it's possible, however by means of private frameworks you can make
(UIApplication.shared.value(forKey: "statusBar") as! NSObject).setValue(UIColor.red, forKey: "foregroundColor")

Carlos Chaguendo
- 2,895
- 19
- 24