Open
Description
@objc public enum TestEnum: Int {
case first = 1
case second = 2
var strValue:String {
switch self {
case .first:
return "first"
case .second:
return "second"
}
}
func getStrValue(_ value: TestEnum) -> String {
return value.strValue
}
If I am using on ObjC
NSLog(@"%@", getStrValue(3));
There are no error prompts during the compilation phase
Crash may occur during the operation phase
Can we detect and predict this error during the compilation phase, and prompt to add default in the Switch