Skip to content

Instantly share code, notes, and snippets.

@michaeleisel
Last active August 29, 2015 14:13
Show Gist options
  • Save michaeleisel/32f7e80ce2186f1edc95 to your computer and use it in GitHub Desktop.
Save michaeleisel/32f7e80ce2186f1edc95 to your computer and use it in GitHub Desktop.
internal extension Array {
func nilFilteredArray<U where T == U?>() -> [U] {
var array = []
for object in self {
if let object = object {
array += [object]
}
}
return array
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment