Created
April 15, 2016 14:47
-
-
Save ezura/88caba4e87a91f458320b0795e8d31aa to your computer and use it in GitHub Desktop.
もらったコードに強制アンラップが多かったのだけど、guard とか let で複数アンラップしたら見通しが良くなった(。 ・ω・)) #swift #CodePiece
This file contains hidden or 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 maybeNil() -> String? { | |
return "sample" | |
} | |
func sample() { | |
guard let a = maybeNil(), | |
let b = maybeNil() else { | |
return | |
} | |
print(a + b) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment