Sample code:
enum BestLetters {
case A
case B
case C
case Default = B
}
The error in the Default
case: Raw value for enum case must be a literal
My understanding is that enum raw values are limited to certain types (Ints, Strings, Booleans, etc). Obviously BestLetters
isn't one of those types and the compiler is complaining.
How can I set the Default
type's raw value to one of the other "letters"? If gives any context, the reason for this odd syntax is that I am trying to imitate something I saw in obj-c.
Thank you for your help.