Skip to content

Instantly share code, notes, and snippets.

@EJSohn
Created May 2, 2018 12:15
// 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