Skip to content

Instantly share code, notes, and snippets.

@alfian0
Forked from loganlinn/ArrayExtensions.swift
Created December 11, 2016 09:30
Show Gist options
  • Save alfian0/d29a42ca1b5d04c86b884853656b5ab3 to your computer and use it in GitHub Desktop.
Save alfian0/d29a42ca1b5d04c86b884853656b5ab3 to your computer and use it in GitHub Desktop.
Swift forEach
extension Array {
func forEach(f: (element: T) -> Void) {
for e in self {
f(element: e)
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment