Last active
March 20, 2017 18:26
-
-
Save JasonCanCode/bc44621dd383b4e91ea50fe2c4a19ea3 to your computer and use it in GitHub Desktop.
func validateArray
This file contains hidden or 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
func validateArray<T>(_ array: [T?]) -> [T] { | |
var validElements: [T] = [] | |
for case let element? in array { | |
validElements.append(element) | |
} | |
return validElements | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment