Last active
August 10, 2021 06:46
-
-
Save michaeleisel/39f53b1f640f6533e4f0754b72ed862f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func iterateOverViewAndSubviews(view: UIView, block: (UIView) -> Void) { | |
block(view) | |
for subview in view.subviews { | |
iterateOverViewAndSubviews(view: subview, block: block) | |
} | |
} | |
func runCheckers() { | |
if let keyWindow = UIApplication.shared.keyWindow { | |
iterateOverViewAndSubviews(view: keyWindow) { (view) in | |
if checkersFail() { | |
fatalError() | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment