Objective-C getter等同于SWIFT

时间:2015-10-09 10:53:17

标签: swift getter uicollectionviewlayout

我有以下的吸气剂:

-(UICollectionViewFlowLayout *)verticalFlowViewLayout {
 if (!_verticalFlowViewLayout) {
 _verticalFlowViewLayout = [[UICollectionViewFlowLayout alloc]init;  
[_verticalFlowViewLayout setItemSize:DeviceIsPad()self.iPadCollectionItemPortraitSize :self.iPhoneCollectionItemPortraitSize];
[_verticalFlowViewLayout setMinimumLineSpacing:MIN_LINE_SPACING];
[_verticalFlowViewLayout setScrollDirection:UICollectionViewScrollDirectionVertical];
}
return _verticalFlowViewLayout;
}

我想将其转换为SWIFT 2.任何帮助?

1 个答案:

答案 0 :(得分:1)

lazy var verticalFlowLayout: UICollectionViewFlowLayout = {
    verticalFlowLayout = UICollectionViewFlowLayout()
    //other configuration here
}()