BSCycleImagesView 0.0.2

BSCycleImagesView 0.0.2

测试已测试
Lang语言 SwiftSwift
许可证 MIT
发布最后发布2016年6月
SPM支持 SPM

blurryssky 维护。



 
依赖
SwiftyTimer~> 1.4.0
AlamofireImage~> 2.4.0
 

  • blurryssky

BSCycleImagesView

概述

BSCycleImagesViewGIF.gif

安装

use_frameworks!

pod ‘BSCycleImagesView’

用法

使用模型作为数据源提供数组

override func viewDidLoad() {
    super.viewDidLoad()
    //auto scroll stay seconds each page, set 0 to stop
    cycleImagesView.timeInterval = 2

    //assume there is 4 jpg in bundle
    var images: [UIImage] = []
    for i in 1...4 {
        let image = UIImage(contentsOfFile: NSBundle.mainBundle().pathForResource("\(i)", ofType: ".jpg")!)!
        images.append(image)
    }

    //set local images
    cycleImagesView.images = images

    //or set image urls, the view will be show after all images downloaded, and will cache images
    cycleImagesView.imageURLs = ["http://img4.duitang.com/uploads/item/201403/31/20140331094819_dayKx.jpeg",
    "http://i1.17173cdn.com/9ih5jd/YWxqaGBf/forum/images/2014/08/05/201143hmymxmizwmqi86yi.jpg",
    "http://p1.image.hiapk.com/uploads/allimg/150413/7730-150413103526-51.jpg",
    "http://s9.knowsky.com/bizhi/l/55001-65000/2009529123133602476178.jpg"]

    //if you need tap
    cycleImagesView.imageDidSelectedClousure = { index in
        print(index)
    }
}