Created
February 13, 2016 12:09
-
-
Save ezura/7b3e7db0695245022687 to your computer and use it in GitHub Desktop.
こっちの方が良い例かも(・ω・)? #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 | |
} | |
class Sample { | |
func hoge() -> String { | |
// 重い処理 | |
return "aaaa" | |
} | |
} | |
let sample = Sample() | |
myDebugPrint(sample.hoge()) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment