Skip to content

Instantly share code, notes, and snippets.

@ezura
Created February 13, 2016 12:03
Show Gist options
  • Save ezura/c18368ff459bf3bd71c4 to your computer and use it in GitHub Desktop.
Save ezura/c18368ff459bf3bd71c4 to your computer and use it in GitHub Desktop.
autoclosure の使い所。デバッグのときのみ評価したい場合? #CodePiece #chocoswift
func myDebugPrint(@autoclosure item: () -> String) {
#if DEBUG
print(item())
#endif
}
myDebugPrint("aaa")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment