Skip to content

Carousel view that can contain UIImage, image url or any view, for iOS App (Swift)

License

Notifications You must be signed in to change notification settings

nakaji-dayo/OmniCarouselView

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

License

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

About

Carousel view that can contain UIImage, image url or any view, for iOS App (Swift)

Resources

License

Stars

Watchers

Forks

Packages

No packages published