Last active
August 11, 2018 18:54
-
-
Save vialyx/054d3a4449bce8e00c78e883e04bdc0e to your computer and use it in GitHub Desktop.
This file contains hidden or 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
enum Weekday: Int { | |
case sun | |
case mon | |
case tue | |
case wed | |
case thur | |
case fri | |
case sat | |
var value: String { | |
switch self { | |
case .sun: | |
return "sun" | |
case .mon: | |
return "mon" | |
case .tue: | |
return "tue" | |
case .wed: | |
return "wed" | |
case .thur: | |
return "thur" | |
case .fri: | |
return "fri" | |
case .sat: | |
return "sat" | |
} | |
} | |
} | |
let dayNumber = 1 | |
let weekday = Weekday(rawValue: dayNumber) | |
print("weekday name: \(weekday.value)") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment