dimanche 6 mars 2016

Initialize enum value in runtime

Is it possible to initialize enum instance in runtime using name of the enum or type?

For example:

let enumName = "EnumName"
let E = StringToEnumType(enumName)
let res = E(rawValue: "some string value from enum")





Aucun commentaire:

Enregistrer un commentaire