Created
July 24, 2019 09:18
-
-
Save zakbarlow1995/8f50a4b2ca8264f54ebf9f35a9bdfebf to your computer and use it in GitHub Desktop.
UIView extension to retrieve all subviews recursively
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
import UIKit | |
extension UIView { | |
var subviewsRecursive: [UIView] { | |
return subviews + subviews.flatMap { $0.subviewsRecursive } | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment