Latest 0.0.4
Homepage https://github.com/swift365/CFBannerView
License MIT
Platforms ios 8.0
Dependencies SDWebImage
Authors

CI Status
Version
License
Platform

Example

<img src="https://github.com/swift365/CFBannerView/blob/master/demo.gif"  alt="效果展示" height="568" width="320" />

To run the example project, clone the repo, and run pod install from the Example directory first.

Use

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. To install
it, simply add the following line to your Podfile:

pod "CFBannerView"

Author

chengfei.heng, [email protected]

License

CFBannerView is available under the MIT license. See the LICENSE file for more info.

Latest podspec

{
    "name": "CFBannerView",
    "version": "0.0.4",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "summary": "CFBannerView is a Swift module for subViews to uiview.",
    "homepage": "https://github.com/swift365/CFBannerView",
    "authors": {
        "chengfei.heng": "[email protected]"
    },
    "source": {
        "git": "https://github.com/swift365/CFBannerView.git",
        "tag": "0.0.4"
    },
    "platforms": {
        "ios": "8.0"
    },
    "source_files": [
        "CFBannerView/Classes/*.swift",
        "CFBannerView/Classes/**/*.swift"
    ],
    "dependencies": {
        "SDWebImage": [
            "~> 3.8.2"
        ]
    },
    "pushed_with_swift_version": "3.0"
}

Pin It on Pinterest

Share This