xxxxxxxxxx
// MARK: Enumerations used in swift
let result = "failure"
let result2 = "failed"
let result3 = "fail"
enum Result {
case success
case failure
}
let res = Result.failure
print(res)
xxxxxxxxxx
enum WeatherType {
case sun
case cloud
case rain
case wind
case snow
}
func getHaterStatus(weather: WeatherType) -> String? {
if weather == .sun {
return nil
} else {
return "Hate"
}
}
getHaterStatus(weather: .cloud)