Skip to content

Latest commit

 

History

History
63 lines (48 loc) · 2.12 KB

File metadata and controls

63 lines (48 loc) · 2.12 KB

OmniCarouselView

Carousel view that can contain UIImage, image url or any view

CI Status Version License Platform

demo movie

Usage

  1. import OmniCarouselView
  2. Putting a UIView in InterfaceBuilder, then set Custom Class to OmniCarouselView
  3. Please see following examples

Examples

Show UIImage

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

Show Image from 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!)})

Show other 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)})

Installation

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

pod "OmniCarouselView"

Customize

key type description
infinite Bool use infinite loop paging(scrolling)
pager Bool show pager indicator

Author

nakaji-dayo, nakaji.dayo@gmail.com

License

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