Skip to main content
added 794 characters in body
Source Link
Jainil Patel
  • 1.3k
  • 10
  • 16

write this in first view controller:

UIApplication.shared.statusBarUIView?.backgroundColor = .white 






extension UIApplication {
    var statusBarUIView: UIView? {
        if #available(iOS 13.0, *) {
            let tag = 38482458385
            if let statusBar = self.keyWindow?.viewWithTag(tag) {
                return statusBar
            } else {
                let statusBarView = UIView(frame: UIApplication.shared.statusBarFrame)
                statusBarView.tag = tag

                self.keyWindow?.addSubview(statusBarView)
                return statusBarView
            }
        } else {
            if responds(to: Selector(("statusBar"))) {
                return value(forKey: "statusBar") as? UIView
            }
        }
        return nil
    }
}

write this in first view controller:

UIApplication.shared.statusBarUIView?.backgroundColor = .white

write this in first view controller:

UIApplication.shared.statusBarUIView?.backgroundColor = .white 






extension UIApplication {
    var statusBarUIView: UIView? {
        if #available(iOS 13.0, *) {
            let tag = 38482458385
            if let statusBar = self.keyWindow?.viewWithTag(tag) {
                return statusBar
            } else {
                let statusBarView = UIView(frame: UIApplication.shared.statusBarFrame)
                statusBarView.tag = tag

                self.keyWindow?.addSubview(statusBarView)
                return statusBarView
            }
        } else {
            if responds(to: Selector(("statusBar"))) {
                return value(forKey: "statusBar") as? UIView
            }
        }
        return nil
    }
}
Source Link
Jainil Patel
  • 1.3k
  • 10
  • 16

write this in first view controller:

UIApplication.shared.statusBarUIView?.backgroundColor = .white