Here is my enum
enum associatedEnums {
case someIntHere(Int)
case someStrHere(String)
}
var associatedEnumsInst = associatedEnums.someStrHere("String here")
I am able to print using
print(associatedEnumsInst)
I get the output as someStrHere("String here")
If i try to print
print(associatedEnumsInst.rawValue)
I get this error: value of type 'associatedEnums' has no member 'rawValue'
I am expecting a output like this "String here"
I am aware that i can do something like this
switch associatedEnumsInst{
case .someIntHere(let val) : print(val)
case .someStrHere(let val) : print(val)
}
But i wanna get the value without using switch statement and only using rawValue property of enums. Is it possible?