Skip to content

Instantly share code, notes, and snippets.

@agoiabel
Last active January 15, 2018 07:28
Show Gist options
  • Save agoiabel/330cff2bc1285a95ce8de860a120ce44 to your computer and use it in GitHub Desktop.
Save agoiabel/330cff2bc1285a95ce8de860a120ce44 to your computer and use it in GitHub Desktop.
// You can also map to strings
enum Week: String {
case Sunday = "Weekday"
case Monday = "Weekday"
case Tuesday = "Weekday"
case Wednessday = "Weekday"
case Thursday = "Weekday"
case Friday = "Weekend"
case Saturday = "Weekend"
}
// You can also map to Int
enum Movement: Int {
case Left = 0
case Right = 1
case Top = 2
case Bottom = 3
}
// Or to floating point
enum Constants: Double {
case π = 3.14159
case e = 2.71828
case φ = 1.61803398874
case λ = 1.30357
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment