Created
December 5, 2016 13:33
-
-
Save kateinoigakukun/a702fd16d1b8612430ed3ee903ffe475 to your computer and use it in GitHub Desktop.
変数名と型が揃ってるとこういう書き方ができるのか #CodePiece
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
enum Hoge { | |
case yoyo(str: String) | |
case hoi(st: String) | |
var string: String { | |
switch self { | |
case .hoi(st: let str), | |
.yoyo(str: let str): | |
return str | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment