# CFBannerView **Repository Path**: chengfeisoft/CFBannerView ## Basic Information - **Project Name**: CFBannerView - **Description**: banner循环播放,同时支持手势滑动 - **Primary Language**: Swift - **License**: MIT - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 9 - **Forks**: 2 - **Created**: 2017-01-07 - **Last Updated**: 2025-06-13 ## Categories & Tags **Categories**: ios-modules **Tags**: None ## README # CFBannerView [![CI Status](http://img.shields.io/travis/chengfei.heng/CFBannerView.svg?style=flat)](https://travis-ci.org/chengfei.heng/CFBannerView) [![Version](https://img.shields.io/cocoapods/v/CFBannerView.svg?style=flat)](http://cocoapods.org/pods/CFBannerView) [![License](https://img.shields.io/cocoapods/l/CFBannerView.svg?style=flat)](http://cocoapods.org/pods/CFBannerView) [![Platform](https://img.shields.io/cocoapods/p/CFBannerView.svg?style=flat)](http://cocoapods.org/pods/CFBannerView) ## Example ![输入图片说明](http://git.oschina.net/uploads/images/2017/0107/182604_e5e2fe6d_302364.gif "在这里输入图片标题") To run the example project, clone the repo, and run `pod install` from the Example directory first. ## Use ```swift let bannerView = CFBannerView(frame:frame) bannerView.dataSource = self bannerView.delegate = self bannerView.reloadData() extension ViewController:CFBannerViewDataSource,CFBannerViewDelegate{ func numberOfItems() -> Int { return banners.count } func viewForItem(bannerView: CFBannerView, index: Int) -> UIView { let imageView = UIImageView(frame: bannerView.bounds) imageView.sd_setImage(with: URL(string: banners[index]), placeholderImage: UIImage(named: "default")) return imageView } func didSelectItem(index: Int) { print(index) } } ``` ## Requirements - iOS 8.0+ - Xcode 8.2+ - Swift 3 ## Installation CFBannerView is available through [CocoaPods](http://cocoapods.org). To install it, simply add the following line to your Podfile: ```ruby pod "CFBannerView" ``` ## Author chengfei.heng, hengchengfei@sina.com ## License CFBannerView is available under the MIT license. See the LICENSE file for more info.