Created
February 13, 2016 12:03
-
-
Save ezura/c18368ff459bf3bd71c4 to your computer and use it in GitHub Desktop.
autoclosure の使い所。デバッグのときのみ評価したい場合? #CodePiece #chocoswift
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
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