tni

TNImageSliderViewController

A Swift image slider component based on UICollectionView

Showing:

Popularity

Downloads/wk

0

GitHub Stars

89

Maintenance

Last Commit

5yrs ago

Contributors

2

Package

Dependencies

0

License

MIT

Categories

Readme

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
  • Set the module field to TNImageSliderViewController if you work with CocoaPods
  • Give the embed segue a name e.g seg_imageSlider
  • Go to the ViewController class in which you have embedded the TNImageSliderViewController class
  • At the top of the file, import TNImageSliderViewController
  • 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, only set this property after the viewDidLoad method has been executed or you will get a runtime error

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

OptionWhat does it do?
scrollDirectionSet the collectionview to scroll horizontal or vertical
backgroundColorA UIColor object to set the background color of the collectionview
pageControlHiddenHides the UIPageControl
pageControlCurrentIndicatorTintColorA UIColor object to set the indicator color
pageControlCurrentIndicatorTintColorA UIColor object to set the indicator color
shouldStartFromBeginningBoolean, start at the first picture
imageContentModeUIViewContentMode, How should the images be scaled

Delegate

If you want to be informed that the image slider has scrolled to a specific page, you can set the delegate property. The delegate has one method imageSlider( imageSlider:TNImageSliderViewController, didScrollToPage pageNumber:Int )

Author

Frederik Jacques, frederik@the-nerd.be

License

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

Rate & Review

Great Documentation0
Easy to Use0
Performant0
Highly Customizable0
Bleeding Edge0
Responsive Maintainers0
Poor Documentation0
Hard to Use0
Slow0
Buggy0
Abandoned0
Unwelcoming Community0
100