SwitchCaseGenerator icon indicating copy to clipboard operation
SwitchCaseGenerator copied to clipboard

Add support for Enums with associated values

Open muuhoffman opened this issue 7 years ago • 0 comments

Say I have the following enum

enum UserField {
        case id(Int)
        case username(String)
        case vision(Int, Int)
        case height(feet: Int, inches: Int)
}

Then the following switch should be generated:

switch value {
case .id(let value):
    break
case .username(let username):
    break
case .vision(let value1, let value2):
    break
case .height(let feet, let inches):
    break
}

muuhoffman avatar Aug 29 '17 17:08 muuhoffman