Created
April 27, 2020 10:52
-
-
Save jeetdholakia/46979e1a67f94d883d212f835fa19ad9 to your computer and use it in GitHub Desktop.
Assigning optional values in Swift
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 lastName: String? | |
var age: Int? = nil | |
var height: Int? = Optional.none | |
var name: String? = Optional.some("Jeet") | |
var middleName: String? = ["firstName": "Jeet", "lastName": "Smith"]["middleName"] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment