Last active
August 29, 2015 14:22
-
-
Save jeremiegirault/09b1b737e64647126d91 to your computer and use it in GitHub Desktop.
fallthrough in swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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