Created
July 18, 2017 03:05
-
-
Save TerryCK/584cce140c83d175f041d79f79d34e33 to your computer and use it in GitHub Desktop.
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
lazy var asHTML: () -> String = { | |
[weak self] in | |
guard let this = self else { return "" } | |
return "<\(this.name)>\(this.text)</\(this.name)>" | |
} | |
//換個角度來看self,先用guard let 安全的解包 optional self,在來使用this |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment