Created
May 21, 2015 17:55
-
-
Save sleroux/eb82bbbfb41e92747b09 to your computer and use it in GitHub Desktop.
To be lazy or not to be...
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
lazy var myLabel: UILabel = { | |
var temporaryLabel : UILabel = UILabel() | |
return temporaryLabel | |
}() | |
let testLabel: UILabel { | |
if !_testLabel { | |
_testLabel = UILabel() | |
} | |
return _testLabel! | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment