Last active
May 20, 2018 15:44
-
-
Save aainaj/98ca434f31f9bd677ad4f4de24de98bf to your computer and use it in GitHub Desktop.
Optional property types for struct
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
import Foundation | |
struct Product { | |
let identifier: Int | |
let name: String | |
var description: String? | |
init(identifier: Int, name: String) { | |
self.identifier = identifier | |
self.name = name | |
} | |
} | |
let productA = Product(identifier: 1234, | |
name: "Remote car") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment