Skip to content

使用UICollectionView实现常见图片无限轮播,支持自定义cell,自定义pageControl,以及轮播样式

License

Notifications You must be signed in to change notification settings

MQZHot/ZCycleView

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

64 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ZCycleView

使用UICollectionView实现常见图片轮播,支持自定义pageControl,自定义Cell

使用方法

let cycleView = ZCycleView()
cycleView.delegate = self
cycleView.reloadItemsCount(images.count)
cycleView.itemSpacing = 10
cycleView.itemSize = CGSize(width: width - 150, height: (width - 150) / 2.3333)
cycleView.initialIndex = 1
view.addSubview(cycleView)

代理方法

protocol ZCycleViewProtocol: class {
    /// 注册cell,[重用标志符:cell类]
    func cycleViewRegisterCellClasses() -> [String: AnyClass]
    /// 配置cell
    func cycleViewConfigureCell(collectionView: UICollectionView, cellForItemAt indexPath: IndexPath, realIndex: Int) -> UICollectionViewCell
    /// 开始拖拽
    func cycleViewBeginDragingIndex(_ cycleView: ZCycleView, index: Int)
    /// 滚动到index
    func cycleViewDidScrollToIndex(_ cycleView: ZCycleView, index: Int)
    /// 点击了index
    func cycleViewDidSelectedIndex(_ cycleView: ZCycleView, index: Int)
    /// 自定义pageControl
    func cycleViewConfigurePageControl(_ cycleView: ZCycleView, pageControl: ZPageControl)
}

About

使用UICollectionView实现常见图片无限轮播,支持自定义cell,自定义pageControl,以及轮播样式

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published