Skip to content

Instantly share code, notes, and snippets.

guard let containerBar = UIApplication.shared.value(forKey: "statusBar") as? UIView else { return true }
guard let statusBarMorden = NSClassFromString("UIStatusBar_Modern"), containerBar.isKind(of: statusBarMorden), let statusBar = containerBar.value(forKey: "statusBar") as? UIView else { return true }
guard let foregroundView = statusBar.value(forKey: "foregroundView") as? UIView else { return true }
for (index, subview) in foregroundView.subviews.enumerated(){
switch index {
case 1:
subview.backgroundColor = .red
case 2:
subview.backgroundColor = .red