Skip to content

Instantly share code, notes, and snippets.

@EJSohn
Created May 2, 2018 12:15
Show Gist options
  • Save EJSohn/c632944d0d9567a01c838b18410c03cd to your computer and use it in GitHub Desktop.
Save EJSohn/c632944d0d9567a01c838b18410c03cd to your computer and use it in GitHub Desktop.
// declare variables.
var today = WeatherCondition.sunny(24)
var yesterday = WeatherCondition.cloudy(Cloud.cirrus, 10)
switch today {
case .sunny(let temperature):
print("today's temperature is \(temperature).")
case .rainy(let inchesPerHour):
print("\(inchesPerHour) inches of rainwater.")
case .cloudy(let cloudType, let windSpeed):
switch cloudType {
case .cirrus:
print("it's cloudy cirrus.")
default:
print("somethig blah..")
}
print("wind speed: \(windSpeed)")
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment