Created
May 2, 2018 12:15
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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