enum IntOrString { case IntValue(Int) case StringValue(String) } func mixedType() { let mixed = [IntOrString.IntValue(1), IntOrString.StringValue("string"), IntOrString.StringValue("Int")] for value in mixed { switch value { case var .IntValue(i): i += 1 print("i: (i)") case let .StringValue(s): print(s) } } }