Latest 0.1.3
Homepage https://github.com/hoggenw/YLBanner
License MIT
Platforms ios 8.0
Authors

CI Status
Version
License
Platform

Example

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

Requirements

Installation

YLBanner is available through CocoaPods. To install
it, simply add the following line to your Podfile:

pod "YLBanner"

调用方法


       let bannerScroller = YLBanner(frame: CGRect(x: 0, y: 0, width: MAIN_WIDTH, height:BannerHeight), 3)
        //你的数据源    
        var array  = [UIImageView]()

        for model in dataArray[0] {
            array.append(model.bannerImageView)
        }
       // 获取数据源
        bannerScroller?.contentViewAtIndex = {(_ pageIndex: Int) in
            if array.count > 0 {
                return array[pageIndex]
            }
            return UIImageView()
        }

        //获取轮播张数,大于1启动轮播
        bannerScroller?.setTotalPagesCount(totalPageCout: { () -> (Int) in
                return array.count

        })

        //点击回调响应
        bannerScroller?.tapActionBlock = {[weak self](index) in
            if (self?.dataArray[0].count)! > 0 {
                let model = self?.dataArray[0][index]
                MobClick.event("Banner")
                print("model?.url=(model?.url)")
                self?.dealModel(model: model!)
            }

        }

Author

hoggenw

License

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

Latest podspec

{
    "name": "YLBanner",
    "version": "0.1.3",
    "summary": "u7b80u6613u529fu80fdu7684u8f6eu64adu89c6u56fe",
    "description": "u7b80u6613u529fu80fdu7684u8f6eu64adu89c6u56feuff0cu4f7fu7528blocku4f20u5165u6570u636eu548cu4f20u51fau64cdu4f5c",
    "homepage": "https://github.com/hoggenw/YLBanner",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "dev-wangliugen": "[email protected]"
    },
    "source": {
        "git": "https://github.com/hoggenw/YLBanner.git",
        "tag": "0.1.3"
    },
    "platforms": {
        "ios": "8.0"
    },
    "source_files": "YLBanner/Classes/**/*",
    "pushed_with_swift_version": "3.0"
}

Pin It on Pinterest

Share This