Tried some methods but showing deprecated in iOS 13.
let application = UIApplication.shared
let statusBarView = application.value(forKey: "statusBar") as! UIView
"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.'"