Skip to content

Instantly share code, notes, and snippets.

@Igor-Palaguta
Created November 9, 2015 19:14
Show Gist options
  • Save Igor-Palaguta/c735964f6351e984d4a1 to your computer and use it in GitHub Desktop.
Save Igor-Palaguta/c735964f6351e984d4a1 to your computer and use it in GitHub Desktop.
enum Choice {
case A
case B
case C
}
func printChoice(choice: Choice, flag: Bool) {
switch choice {
case .A, .B, .C where flag:
print("true")
default:
print("false")
}
}
printChoice(.A, flag: false)
@Igor-Palaguta
Copy link
Author

prints true

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment