Skip to content

Instantly share code, notes, and snippets.

@Pasanpr
Last active April 11, 2017 14:47
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 Pasanpr/bda1bfb8e302ed80abf9204b7f3ff6d6 to your computer and use it in GitHub Desktop.
Save Pasanpr/bda1bfb8e302ed80abf9204b7f3ff6d6 to your computer and use it in GitHub Desktop.
enum WeatherIcon: String {
case clearDay = "clear-day"
case clearNight = "clear-night"
case rain = "rain"
case snow = "snow"
case sleet = "sleet"
case wind = "wind"
case fog = "fog"
case cloudy = "cloudy"
case partlyCloudyDay = "partly-cloudy-day"
case partlyCloudyNight = "partly-cloudy-night"
case `default`
init(rawValue: String) {
switch rawValue {
case "clear-day": self = .clearDay
case "clear-night": self = .clearNight
case "rain": self = .rain
case "snow": self = .snow
case "sleet": self = .sleet
case "wind": self = .wind
case "fog": self = .fog
case "cloudy": self = .cloudy
case "partly-cloudy-day": self = .partlyCloudyDay
case "partly-cloudy-night": self = .partlyCloudyNight
default: self = .default
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment