07-18-2023, 11:35 PM
I had set specific color (in RGB format) using below code in `App Delegate` file:
func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
. . .
UIApplication.sharedApplication().statusBarHidden = false
UIApplication.sharedApplication().statusBarStyle = .LightContent
let statusBar: UIView = UIApplication.sharedApplication().valueForKey("statusBar") as! UIView
if statusBar.respondsToSelector(Selector("setBackgroundColor:")) {
statusBar.backgroundColor = UIColor.init(red: 0.1, green: 0.27, blue: 0.60, alpha: 1.0)
}
. . .
}
You also need to add below key in `Info.plist` file :
**View controller-based status bar appearance** with boolean value set to **NO**
[![Screenshot 1][1]][1]
[![Screenshot 2][2]][2]
[1]:
[2]: