Last active
February 1, 2017 11:55
-
-
Save ianpartridge/4ab85eccd4f13b64071316288e1da456 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
// You have an enumeration: | |
enum Enum { | |
case foo(Int) | |
case bar(String) | |
case qux(Int) | |
} | |
// And you have an array of them: | |
let items: [Enum] = [.foo(1), .bar("hi"), .foo(2)] | |
// Create a second array containing only one case, for example foo. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment