There is a simple area with the Navigation Bar at the top, and after it the stretched Table View.
Navigation Bar has painted some RGB color and now there is a need to paint the area above it in the same color - Status Bar.
In the file AppDelegate.swift in the application I added this line:
UIApplication.shared.statusBarView?.backgroundColor = UIColor.init(red: CGFloat(7), green: CGFloat(14), blue: CGFloat(30), alpha: CGFloat(1)) And at the very bottom of the expanded UIApplication :
extension UIApplication { var statusBarView: UIView? { return value(forKey: "statusBar") as? UIView } } Does not work. But if UIColor.init() replaced, for example, with .red , the Status Bar will turn red.
Why doesn't UIColor.init() and how can I set my RGB color in the Status Bar?