Skip to content

Instantly share code, notes, and snippets.

@ianpartridge
Last active February 1, 2017 11:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ianpartridge/4ab85eccd4f13b64071316288e1da456 to your computer and use it in GitHub Desktop.
Save ianpartridge/4ab85eccd4f13b64071316288e1da456 to your computer and use it in GitHub Desktop.
// 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