支持
- iOS 8+
看一下几个demo
![demo列表](https://github.com/wangrui460/WRCycleScrollView/raw/master/screenshots/demos.png)
![知乎日报](https://github.com/wangrui460/WRCycleScrollView/raw/master/screenshots/%E7%9F%A5%E4%B9%8E%E6%97%A5%E6%8A%A5.gif)
![本地图片轮播](https://github.com/wangrui460/WRCycleScrollView/raw/master/screenshots/%E6%9C%AC%E5%9C%B0%E5%9B%BE%E7%89%87%E8%BD%AE%E6%92%AD.gif)
![网络图片轮播](https://github.com/wangrui460/WRCycleScrollView/raw/master/screenshots/%E7%BD%91%E7%BB%9C%E5%9B%BE%E7%89%87%E8%BD%AE%E6%92%AD.gif)
![StoryBoard创建](https://github.com/wangrui460/WRCycleScrollView/raw/master/screenshots/StoryBoard%E5%88%9B%E5%BB%BA.gif)
![不无限轮播](https://github.com/wangrui460/WRCycleScrollView/raw/master/screenshots/%E4%B8%8D%E6%97%A0%E9%99%90%E8%BD%AE%E6%92%AD.gif)
![不显示pageControl](https://github.com/wangrui460/WRCycleScrollView/raw/master/screenshots/%E4%B8%8D%E6%98%BE%E7%A4%BApageControl.gif)
如何使用
var cycleScrollView:WRCycleScrollView?
let height = 520 * kScreenWidth / 1080.0
let frame = CGRect(x: 0, y: 150, width: kScreenWidth, height: height)
// 可加载网络图片或者本地图片
let serverImages = ["http://mobile/s252_05471521705899113.png",.......]
// 构造方法
cycleScrollView = WRCycleScrollView(frame: frame, type: .SERVER, imgs: serverImages)
view.addSubview(cycleScrollView!)
// 添加代理
cycleScrollView?.delegate = self
代理方法(点击事件 和 图片滚动事件)
extension ServerImgController: WRCycleScrollViewDelegate
{
/// 点击图片事件
func cycleScrollViewDidSelect(at index:Int, cycleScrollView:WRCycleScrollView)
{
print("点击了第\(index+1)个图片")
}
/// 图片滚动事件
func cycleScrollViewDidScroll(to index:Int, cycleScrollView:WRCycleScrollView)
{
print("滚动到了第\(index+1)个图片")
}
}
demo下载地址:WRCycleScrollView
强烈推荐:超简单!!! iOS设置状态栏、导航栏按钮、标题、颜色、透明度,偏移等
https://github.com/wangrui460/WRNavigationBar
https://github.com/wangrui460/WRNavigationBar_swift
欢迎关注我的微博:wangrui460
网友评论