OmniCarouselView 0.1.0

OmniCarouselView 0.1.0

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

Daishi Nakajima维护。



可以包含 UIImage、图片 URL 或任何视图的轮播视图

demo movie

使用方法

  1. import OmniCarouselView
  2. 在 InterfaceBuilder 中放置一个 UIView,然后设置 Custom Class 为 OmniCarouselView
  3. 请参阅以下示例

示例

显示 UIImage

let images = [UIImage(named: "beer1"), UIImage(named: "beer2"), UIImage(named: "beer3")]
carouselView1.contents = images
  .filter({$0 != nil})
  .map({OmniCarouselView.Content.Image($0!)})

从 URL 显示图片

let imageUrls = Array(1...3).map({i in NSURL(string: "https://raw.githubusercontent.com/nakaji-dayo/OmniCarouselView/master/Example/OmniCarouselView/Images.xcassets/beer\(i).imageset/beer\(i).jpeg")})
carouselView2.contents = imageUrls.filter({$0 != nil}).map({OmniCarouselView.Content.ImageUrl($0!)})

显示其他 UIView

let labels = Array(0..<3).map { (i) -> UILabel in
    let label = UILabel()
    label.text = "label:\(i)"
    return label
}
carouselView3.contents = labels.map({OmniCarouselView.Content.View($0)})

安装

OmniCarouselView 通过 CocoaPods 提供。要安装,只需将以下行添加到您的 Podfile 中

pod "OmniCarouselView"

自定义

key type description
infinite Bool 使用无限循环翻页(滚动)
pager Bool 显示页面指示器

作者

nakaji-dayo, [email protected]

许可证

OmniCarouselView 在 MIT 许可下提供。有关更多信息,请参阅 LICENSE 文件。