thinkscientist / TNImageSliderViewController

A Swift image slider component based on UICollectionView

Home Page:http://www.the-nerd.be/2015/06/22/tnimagesliderviewcontroller-image-slider-for-swift/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

TNImageSliderViewController

Version License Platform

What

TNImageSliderViewController is an image slider component written in Swift. It creates a slideshow of images which can slide horizontal or vertical. This component can deal with orientation changes.

Demo

Demo

Usage

To run the example project, clone the repo, and run pod install from the Example directory first.

Installation

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

pod "TNImageSliderViewController"

Using storyboards

  • Add a container view to your Storyboard.
  • Set the class in the Identity Inspector to TNImageSliderViewController
  • Give the embed segue a name e.g seg_imageSlider
  • Go to the ViewController class in which you have embedded the TNImageSliderViewController class
  • Create a property to hold the instance of TNImageSliderViewController
  • Fill in this property in prepareForSegue:identifier:
  • Set the images property of the TNImageSliderViewController to an array of UIImage objects

If you want, you can also set the options property (instance of TNImageSliderViewOptions)

Option What does it do?
scrollDirection Set the collectionview to scroll horizontal or vertical
backgroundColor A UIColor object to set the background color of the collectionview
pageControlHidden Hides the UIPageControl
pageControlCurrentIndicatorTintColor A UIColor object to set the indicator color

Author

Frederik Jacques, frederik@the-nerd.be

License

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

About

A Swift image slider component based on UICollectionView

http://www.the-nerd.be/2015/06/22/tnimagesliderviewcontroller-image-slider-for-swift/

License:MIT License


Languages

Language:Swift 49.1%Language:Shell 39.1%Language:Objective-C 4.5%Language:Ruby 4.4%Language:C 2.9%