CaseIterable
Here’s the code if you want to experiment with it!
import Foundation
enum Direction: CaseIterable {
case north
case south
case east
case west
}
Direction.allCases // [.north, .south, .east, .west]
Here’s the code if you want to experiment with it!
import Foundation
enum Direction: CaseIterable {
case north
case south
case east
case west
}
Direction.allCases // [.north, .south, .east, .west]