Last active
May 9, 2016 02:08
-
-
Save ohtwo/331660e9f2d4d1aabdd234418937676a to your computer and use it in GitHub Desktop.
Lazy Variable without Capturing
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 icon: UIImage = { [unowned self] in | |
guard let iconName = self.iconName, icon = UIImage(named: iconName) else { | |
return UIImage() | |
} | |
return icon | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment