Created
March 1, 2018 02:57
-
-
Save quocnb/0cfb49567d195a55fd30ae3aafdecddc to your computer and use it in GitHub Desktop.
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
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