This file contains hidden or 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
extension UIView { | |
func findSubview(where matches: (UIView) -> Bool) -> UIView? { | |
for subview in subviews { | |
if matches(subview) { | |
return subview | |
} else if let match = subview.findSubview(where: matches) { | |
return match |
OlderNewer