Skip to content

Instantly share code, notes, and snippets.

@fitomad fitomad/for_non-nil.swift Secret
Created Dec 21, 2018

Embed
What would you like to do?
let numbers = [ 1, 2, nil, 4, 5, nil, nil, 8, nil, 10 ]
for case let number? in numbers
{
print(number)
}
/**
1
2
4
5
8
10
*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.