Skip to content

Instantly share code, notes, and snippets.

@NavdeepSinghh
Last active June 4, 2020 02:03
Show Gist options
  • Save NavdeepSinghh/6e6ff9cf6009238751df90bf5d53f1d1 to your computer and use it in GitHub Desktop.
Save NavdeepSinghh/6e6ff9cf6009238751df90bf5d53f1d1 to your computer and use it in GitHub Desktop.
enum Month {
case January
case February
case March
case April
case May
case June
case July
case August
case September
case October
case November
case December
var season: String {
switch self {
case Month.December, Month.January, Month.February:
return "Winter"
case Month.March, Month.April, Month.May:
return "Spring"
case Month.June, Month.July, Month.August:
return "Summer"
case Month.September, Month.October, Month.November:
return "Autumn"
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment