Raw Values and CaseIterable
Enums backed by String, Int or other RawRepresentable types plus allCases.
Welcome
Swift enums can have *raw values* — literal values stored with each case. Conforming to `CaseIterable` gives you a collection of all cases automatically.
Raw Value Enums
```swift
enum Direction: String {
case north = "N"
case south = "S"
case east = "E"
case west = "W"
}
print(Direction.north.rawValue) // "N"
```
All lessons in this course
- Raw Values and CaseIterable
- Associated Values for Rich Data
- Indirect Enums and Recursive Structures
- Modeling State Machines with Enums