Skip to content
Brian Mullen edited this page Dec 4, 2016 · 4 revisions

Enums are automatically supported as long as they conform to RawRepresentable. There is no need to worry about adding additional protocols to your enum.

Example

enum DayOfWeek: Int {
    case sunday
    case monday
    case tuesday
    case wednesday
    case thursday
    case friday
    case saturday
}

let today: DayOfWeek = try json.value(for: "today")

Clone this wiki locally