OmniCarouselView 0.1.0

OmniCarouselView 0.1.0

TestsTested
LangLanguage SwiftSwift
License MIT
ReleasedLast Release Mar 2016
SPMSupports SPM

Maintained by Daishi Nakajima.



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

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, [email protected]

License

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