在非平凡块中的Objective-C中,我注意到了weakSelf / strongSelf的使用.
在Swift中使用strongSelf的正确方法是什么?@H_403_2@就像是:
if let strongSelf = self { strongSelf.doSomething() }
因此,对于每个包含self的闭包,我应该添加strongSelf检查?
if let strongSelf = self { strongSelf.doSomething1() } if let strongSelf = self { strongSelf.doSomething2() }
有没有办法让上述更优雅?