Skip to content

Instantly share code, notes, and snippets.

@quocnb
Created March 1, 2018 02:57
Show Gist options
  • Save quocnb/0cfb49567d195a55fd30ae3aafdecddc to your computer and use it in GitHub Desktop.
Save quocnb/0cfb49567d195a55fd30ae3aafdecddc to your computer and use it in GitHub Desktop.
extension Sequence {
func forEach(_ closure: (Element) -> () -> Void) {
for element in self {
closure(element)()
}
}
}
let arr = [view1, view2]
arr.forEach(UIView.removeFromSuperview)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment