Skip to content

Instantly share code, notes, and snippets.

@jeremiegirault
Last active August 29, 2015 14:22
Show Gist options
  • Save jeremiegirault/09b1b737e64647126d91 to your computer and use it in GitHub Desktop.
Save jeremiegirault/09b1b737e64647126d91 to your computer and use it in GitHub Desktop.
fallthrough in swift
enum State {
case Begin
case Changed
case End
}
let state: State = .Begin
switch(state) {
case .Begin, .Changed:
NSLog("Begin or changed")
fallthrough
case .Begin:
NSLog("Begin")
case .End:
NSLog("End")
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment