Text color of the wordings in status bar cannot be changed. Status Bar background color is able to change. How can I change the text color in that?
UIApplication.shared.statusBarStyle = .lightContent // Light content, for use on dark backgrounds
UIApplication.shared.statusBarStyle = .default // Dark content, for use on light backgrounds
Don’t forget to edit “View controller-based status bar appearance” in info.plist and set it to NO.
How can I give textcolor in status bar?
The only thing that you could do is to change the UIStatusBarStyle, which could be one of the two following options:
A dark status bar, intended for use on light backgrounds.
A light status bar, intended for use on dark backgrounds.
So, if you are aiming to change the color of the elements in the status bar (black color in first screenshot and white color in second screenshot) to gray -for instance-, that would be not possible, you have to stick of one of the mentioned two options.
How to change the status bar style?
You could check the following answered question to implement it:
- How to set Status Bar Style in Swift 3.
- Changing the Status Bar Color for specific ViewControllers using Swift in iOS8.