Swift: A Swift Tour - Enumerations and Structures
Use enum to create an enumeration. Like classes and all other named types, enumerations can have methods associated with them.= 'enum'을 사용해 열거형을 만들고, 클래스들이나 모든 다른 명명된 타입들 처럼 열거형은 메소드를 가질 수 있다ex)enum Rank: Int { case ace = 1 case two, three, four, five, six, seven, eight, nine, ten case jack, queen, king func simpleDescription() -> String { switch self { case .ace: ..
2023. 7. 20.