Assign rawValus to Enums
GerdC opened this issue · comments
Gerd Castan commented
I'd like to have an easy way to store App and Mode in UserDefaults.
A common way to to this is to store raw values and create the Enum instances from the raw value like
let test1 = App(rawValue: 0)
let test2 = App(rawValue: "appleMaps")
At the moment, the Enums in Karte don't support this, because they're not assigned to a raw value like
public enum App: int {
or
public enum App: String {
Please consider App and Mode as Int or String to make it easy to store those values in UserDefaults
Kilian Koeltzsch commented
Seems like a very reasonable request, I've just added raw string values to both 😊 Thanks for the hint!
Kilian Koeltzsch commented
Just published v1.2.0 with these changes 😊