I have a enum
in my Swift class and a variable declared. I need to encode and decode it using NSCoder
. There are a lot of questions about this saying that I should use rawValue
. Enum
is declared the following way:
enum ConnectionType {
case Digital, PWM
}
But in Swift 1.2 there is no such initialiser. How do do that in Swift 1.2 and Xcode 6.3?