Lazy 属性的代码块只会调用一次,lazy修饰的是一个存储属性,而存放的是闭包
lazy var reuseSet = {Set<UIImageView>()}()
类似oc的
@property (nonatomic, strong)NSMutableSet *dataSet;
- (NSMutableSet *)dataSet {
if (nil == _dataSet){
_dataSet = [NSMutableSet set];
}
return _dataSet
}