Skip to content

Instantly share code, notes, and snippets.

@jarsen
Last active August 3, 2017 21:16
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 jarsen/609927aca9890b294cb6 to your computer and use it in GitHub Desktop.
Save jarsen/609927aca9890b294cb6 to your computer and use it in GitHub Desktop.
conform to this protocol and get a debugPrint for free
protocol Debuggable {
var debug: Bool { get set }
func debugPrint(message: String)
}
extension Debuggable {
func debugPrint(message: String) {
if debug {
print(message)
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment