Created
June 11, 2014 05:10
-
-
Save yuanw/48c7fdd9da8b88ea0d49 to your computer and use it in GitHub Desktop.
Option
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
| var optionalString: String? = "Hello" | |
| optionalString = nil | |
| var optionalName: String? = nil | |
| var gretting = "Hello!" | |
| if let name = optionalName { | |
| gretting = "Hello, \(name)" | |
| } else { | |
| gretting = "Hello anonymous" | |
| } | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment