statusBarFrame' was deprecated in iOS 13.0: Use the statusBarManager property of the window scene instead iOS swift
Problem:
I had a warning for my below code
let statusBarView = UIView(frame: UIApplication.shared.
statusBarView.backgroundColor = UIColor.red // Set your desired background color
self.view.addSubview(
As like below
'statusBarFrame' was deprecated in iOS 13.0: Use the statusBarManager property of the window scene instead.
How to solve that.
Solution:
if let windowScene = UIApplication.shared.connected
if let statusBarManager = windowScene.statusBarManager {
let statusBarFrame = statusBarManager.statusBarFram
let statusBarView = UIView(frame: statusBarFrame)
statusBarView.backgroundColor = UIColor.red
self.view.addSubview(
}
}
Comments
Post a Comment