Skip to content

Instantly share code, notes, and snippets.

@zakbarlow1995
Created July 24, 2019 09:18
Show Gist options
  • Save zakbarlow1995/8f50a4b2ca8264f54ebf9f35a9bdfebf to your computer and use it in GitHub Desktop.
Save zakbarlow1995/8f50a4b2ca8264f54ebf9f35a9bdfebf to your computer and use it in GitHub Desktop.
UIView extension to retrieve all subviews recursively
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