FZCarousel 0.1.2

FZCarousel 0.1.2

测试已测试
语言语言 Obj-CObjective C
许可 自定义
发布最后发布2015年9月

Noah Blake维护。



演示

demo

介绍

FZCarouselCollectionViewDelegate 提供了一个简单、轻量的接口来生成一个“无限”滚动的轮播图。

用法

实现子类

此类的使用者应首先从类中派生子类。子类应处理所有需要重写的 UICollectionViewDataSource、UICollectionViewDelegateFlowLayout 和 UICollectionViewDelegate 方法,以生成所需的 collectionView 布局。至少,预计用户将重写 -collectionView:cellForItemAtIndexPath: 方法,如果没有这样做将会抛出异常。

此类将处理所有“轮播图相关问题”,包括数据数组的操作和同步、页面控制更新以及当然,轮播图滚动。

标准配置

self.carouselCollectionViewDelegate = [FZDemoCarouselCollectionViewDelegate carouselCollectionViewDelegateForCollectionView:self.collectionView dataArray:self.dataArray defaultCrankInterval:2.0f lazyCrankInterval:2.5f];

响应用户选择单元格

self.carouselCollectionViewDelegate.didSelectCellBlock = 
^(UICollectionView *inCollectionView, NSIndexPath *inIndexPath, id inDataForIndexPath)                          
{                                               
    [tmpSelf showSelectionIndicator:YES withData:inDataForIndexPath];
};

控制轮播图

[self.carouselCollectionViewDelegate beginCarousel];
[self.carouselCollectionViewDelegate endCarousel];