Skip to content

Instantly share code, notes, and snippets.

@michaeleisel

michaeleisel/a.swift

Last active Dec 12, 2018
Embed
What would you like to do?
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
You can’t perform that action at this time.