I'm trying to get a default value for the enum so I can use it as a param. This code isn't working, but I'd like to get something like:
print("Param: \(Params.RCLoss.description)")
and the output should be:
Param: RC_LOSS_MAN
Here is the code:
enum Params {
enum RCLoss: Int32, CustomStringConvertible {
case disable = 0
case enable = 1
var description: String {
return "RC_LOSS_MAN"
}
}
}
I want to be able to pass this:
set(parameterType: Params.RCLoss.description, parameterValue: Params.RCLoss.enable)
which should correspond to these values being set:
set(parameterType: "RC_LOSS_MAN", parameterValue: 0)