swift 5 change status bar background color code example
Example 1: swift change background color
self.view.backgroundColor = UIColor.red
Example 2: swift change status bar color
override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated)
setNeedsStatusBarAppearanceUpdate()
}
override var preferredStatusBarStyle: UIStatusBarStyle {
.lightContent
}