For ios 13 I can't set text color of the status bar. How I can get the view of statusBarManager? How I can change the text color only?
due to:
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.'
My current code:
func setStatusBarTextColor(_ color: UIColor) {
if #available(iOS 13.0, *) {
// How to do for iOS 13??
} else {
if let statusBar = UIApplication.shared.value(forKey: "statusBar") as? UIView {
statusBar.setValue(color, forKey: "foregroundColor")
}
}
}
I have already found this https://stackoverflow.com/a/57394751/9172697 but it's not what i looking for