Created
November 4, 2018 01:01
-
-
Save mikebuss/a01890e1cb5d8616613d8530eba95845 to your computer and use it in GitHub Desktop.
lazy-person.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
class Person { | |
var name: String | |
lazy var personalizedGreeting: String = { | |
return "Hello, \(self.name)!" | |
}() | |
init(name: String) { | |
self.name = name | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment