Difference between associated and raw values in swift enumerations
问题 Swift enumerations have both associated and raw values. But the use cases of these values is not clear to me. So I would really appreciate if anyone can explain the difference between the associated and raw values, an example would be very helpful. 回答1: Raw values are for when every case in the enumeration is represented by a compile-time-set value. The are akin to constants, i.e. let A = 0 let B = 1 is similar to: enum E: Int { case A // if you don't specify, IntegerLiteralConvertible-based