Earlier on Xcode 10 and swift 5 I used to change the status bar color as follows:-
if let statusBar = UIApplication.shared.value(forKey: "statusBar") as? UIView {
if statusBar.responds(to: #selector(setter: UIView.backgroundColor)) {
statusBar.backgroundColor = #colorLiteral(red: 0, green: 0.7156304717, blue: 0.9302947521, alpha: 1)
}
}
Now on Xcode 11 & Swift 5.1 I get the following error:-
Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'App called -statusBar or -statusBarWindow on UIApplication: this code must be changed as there's no longer a status bar or status bar window. Use the statusBarManager object on the window scene instead.'
Any suggestions?