Skip to content

Instantly share code, notes, and snippets.

@yashigani
Created June 4, 2014 01:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yashigani/a2a6f3edfecc3269766b to your computer and use it in GitHub Desktop.
Save yashigani/a2a6f3edfecc3269766b to your computer and use it in GitHub Desktop.
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