【文件属性】:
文件名称:轮播视图swift版,代码量少.zip
文件大小:6KB
文件格式:ZIP
更新时间:2022-07-31 04:00:22
滚动视图
一个swift写的广告轮播组件,支持代理和闭包的形式设置数据源和事件代理。代码少容易修改,可以很方便定制。支持Cocoapods,支持swift 3
github: https://github.com/chinabrant/BBannerView
self.banner2.numberOfItems = { (bannerView: BBannerView) -> Int in
return self.images.count
}
self.banner2.viewForItem = { (bannerView: BBannerView, index: Int) -> UIView in
let imageView = UIImageView(frame: bannerView.bounds)
imageView.image = UIImage(named: self.images[index])
return imageView
}
self.banner2.tap = { (bannerView: BBannerView, index: Int) in
print("banner2 tap: %d", index)
}
banner2.reloadData()
banner2.startAutoScroll(timeIntrval: 2)
【文件预览】:
BBannerView
----.DS_Store(6KB)
----BBannerView.swift(7KB)