Created
June 4, 2014 01:34
-
-
Save yashigani/a2a6f3edfecc3269766b to your computer and use it in GitHub Desktop.
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 Debug { | |
case Log(Bool) | |
func log(message: String) { | |
switch self { | |
case Log(true): | |
println(message) | |
case Log(false): | |
return | |
default: | |
return | |
} | |
} | |
} | |
// Usage | |
// let debug = Debug.Log(true) | |
// debug.log("Cool!") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment