Hi Guys,
I got a permanent solution for this.
if #available(iOS 13.0, *) {
let window = UIApplication.shared.windows.first
let topPadding = window?.safeAreaInsets.top
let statusBar = UIView(frame: CGRect(x: 0, y: 0, width: UIScreen.main.bounds.size.width, height: topPadding ?? 0.0))
statusBar.backgroundColor = UIColor(named: "AppPrimaryColor")
UIApplication.shared.windows.filter {$0.isKeyWindow}.first?.addSubview(statusBar)
}
Post
Replies
Boosts
Views
Activity
Hi,
For this, I got a permanent solution. Please check this out
Code:
if #available(iOS 13.0, *) {
let window = UIApplication.shared.windows.first
let topPadding = window?.safeAreaInsets.top
let statusBar = UIView(frame: CGRect(x: 0, y: 0, width: UIScreen.main.bounds.size.width, height: topPadding ?? 0.0))
statusBar.backgroundColor = UIColor(named: "AppPrimaryColor")
UIApplication.shared.windows.filter {$0.isKeyWindow}.first?.addSubview(statusBar)
}
Use this and thank me later.