一个有趣的集合视图轮布局。这里是 Swift 版本
iOS 7.0 或更高版本。
1.克隆此仓库;
2.将源文件“CPCollectionViewWheelLayout.h”和“CPCollectionViewWheelLayout.m”添加到您的项目中。
CPCollectionViewWheelLayout *wheelLayout =
[[CPCollectionViewWheelLayout alloc] initWithRadius:self.view.bounds.size.width/1.8
cellSize:CGSizeMake(60, 60)
angular:20
fadeAway:NO
layoutType:self.layoutType];
UICollectionView *collectionView =
[[UICollectionView alloc] initWithFrame:CGRectMake(0, 64, self.view.bounds.size.width, self.view.bounds.size.height-64) collectionViewLayout:wheelLayout];
collectionView.showsVerticalScrollIndicator = NO;
collectionView.showsVerticalScrollIndicator = NO;
collectionView.backgroundColor = [UIColor clearColor];
collectionView.dataSource = self;
collectionView.delegate = self;
[collectionView registerClass:[CPCollectionViewCell class]
forCellWithReuseIdentifier:NSStringFromClass([CPCollectionViewCell class])];
MIT