I am using iOS 11 safe area layout guidelines and set background color of status bar like this
extension UIApplication {
var statusBarView: UIView? {
return value(forKey: "statusBar") as? UIView
}
}
UIApplication.shared.statusBarView?.backgroundColor = .green
When presenting a controller with the red background it doesn't cover status bar as shown in the image but it works fine when not using safe area layout guidelines. Whats going wrong here?
let vc = UIViewController()
vc.modalPresentationStyle = .overFullScreen
vc.backgroundColor = .red
present(vc, animated: true, completion: nil)