|
1
这里中括号后面的(self)是什么意思?_?
|
|
guitarkittenSep 30, 2017
2
{ this in .... }(self) 这不就是一个调用么?
|
|
abcyuxue123Sep 30, 2017
3
感觉 ls +1
可以去掉 self 尝试运行,结果应该一样 |
|
4
|
|
NxiJSiOSSep 30, 2017
5
Since self is a struct you can ’ t create weak or unowned references. Instead, pass self to the closure or function that initialized the lazy variable.
|
|
6
@NxiJSiOS 貌似明白了点,就是在 struct 里面直接使用 self 的话会报错必须这样传进去?
|
|
engHackerSep 30, 2017 via iPhone
7
@zenghaojim33 ❌
|
|
showme1121Sep 30, 2017 via iPhone
8
@zenghaojim33 this 是整个 closure 的参数啊
|
|
9
@showme1121 但是( self )又是什么
|
|
airdropOct 11, 2017
10
closure 的调用吧
|
|
shawndevOct 15, 2017
11
lazy var button : UIButton = {
$0.hide = true }(UIButton()) 和这种写法是一样的 |
|
12
@shawndev 明白了,那如果把 UIButton()放到闭包里面是不是一样的?
|