Skip to content

Instantly share code, notes, and snippets.

@soggybag
Last active November 6, 2015 15:12
Show Gist options
  • Save soggybag/06ea9602f5cd3c3abce3 to your computer and use it in GitHub Desktop.
Save soggybag/06ea9602f5cd3c3abce3 to your computer and use it in GitHub Desktop.
Enum Example, stores colors used by your app.
// Create a color
var myColor = TagColor.Red
// or, set a var to type TagColor
var aColor: TagColor
// Assign a TagColor
aColor = TagColor.Blue
// Alternately use the shorthand form
aColor = .Blue
enum TagColor {
case Red, Orange, Yellow, Green, Blue, Purple
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment