Last active
November 6, 2015 15:12
-
-
Save soggybag/06ea9602f5cd3c3abce3 to your computer and use it in GitHub Desktop.
Enum Example, stores colors used by your app.
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
// 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 |
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
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