项目介绍:
InfiniteCollectionView
无限横向轮播视图,使用UICollectionView做成。
DEMO 下载:
Requirements
- iOS 8.0+
- Swift 2.2+
- ARC
install
CocoaPods
Adding the following to your Podfile and running pod install:
use_frameworks!
pod "InfiniteCollectionView"
import
import InfiniteCollectionView
Usage
initialize
@IBOutlet weak var collectionView: InfiniteCollectionView!
delegate, dataSource
[Objective-C] 查看源文件 复制代码
collectionView.infiniteDataSource = XXX collectionView.infiniteDelegate = XXX collectionView.cellWidth = XXX // protocol func cellForItemAtIndexPath(collectionView: UICollectionView, dequeueIndexPath: NSIndexPath, indexPath: NSIndexPath) -> UICollectionViewCell func numberOfItems(collectionView: UICollectionView) -> Int // optional func didSelectCellAtIndexPath(collectionView: UICollectionView, indexPath: NSIndexPath) func didUpdatePageIndex(index: Int)
推荐代码:
专题集合 十六 每周iOS精选推送