Status Bar Style and background color in Swift 3

override var preferredStatusBarStyle: UIStatusBarStyle {
    return .lightContent
}

extension UIApplication {
    var statusBarView: UIView? {
        return value(forKey: "statusBar") as? UIView
    }
}

UIApplication.shared.statusBarView?.backgroundColor = .red

Popular posts from this blog

How to Use pagination ScrollView in Swift

UISearchBar search text color , background color swift 3