You need to add below key in your Info.plist file:
View controller-based status bar appearance
with boolean value set to NO
In your appdelegate class, in didFinishLaunchingWithOptions
method before return.
let statusBar: UIView = UIApplication.shared.value(forKey: "statusBar") as! UIView
if statusBar.responds(to:#selector(setter: UIView.backgroundColor)) {
statusBar.backgroundColor = UIColor.red
}
UIApplication.shared.statusBarStyle = .lightContent
change backgroundColor
and statusBarStyle
as per requirement.