UICollectionViewFlowLayout

UICollectionViewFlowLayout

我有以下吸气剂:

-(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;
}


我想将其转换为SWIFT2。有什么帮助吗?

最佳答案

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

关于swift - 相当于SWIFT的Objective-C setter/getter ,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/33036417/

10-13 04:22