To run the example project, clone the repo, and run pod install
from the Example directory first
let images: [UIImage] = [UIImage(named: "1")!,UIImage(named: "2")!,UIImage(named: "3")!,UIImage(named: "4")!,UIImage(named: "5")!,UIImage(named: "6")!]
let slider1: LIHSlider = LIHSlider(images: images)
slider1.sliderDescriptions = ["Image 1 description","Image 2 description","Image 3 description","Image 4 description","Image 5 description","Image 6 description"]
self.sliderVc1 = LIHSliderViewController(slider: slider1)
sliderVc1.delegate = self
self.addChildViewController(self.sliderVc1)
self.view.addSubview(self.sliderVc1.view)
self.sliderVc1.didMoveToParentViewController(self)
let slider2: LIHSlider = LIHSlider(images: images)
//customizations
slider2.transitionInterval = 5.0
slider2.transitionStyle = UIPageViewControllerTransitionStyle.PageCurl
slider2.slidingOrientation = UIPageViewControllerNavigationOrientation.Vertical
slider2.sliderNavigationDirection = UIPageViewControllerNavigationDirection.Reverse
slider2.showPageIndicator = false
self.sliderVc2 = LIHSliderViewController(slider: slider2)
self.addChildViewController(self.sliderVc2)
self.view.addSubview(self.sliderVc2.view)
self.sliderVc2.didMoveToParentViewController(self)
Implement LIHSliderDelegate
func itemPressedAtIndex(index index: Int) {
}
public var sliderImages: [UIImage]
public var sliderDescriptions: [String] //leave empty to remove description
public var descriptionColor: UIColor //default is white
public var descriptionBackgroundAlpha: CGFloat //default is 0.3
public var descriptionBackgroundColor: UIColor //default is black
public var descriptionFont: UIFont //default is system font with size 15
public var numberOfLinesInDescription: Int //default is 2
public var transitionInterval: Double //default is 3.0
public var customImageView: UIImageView?
public var showPageIndicator: Bool //default is true
public var userInteractionEnabled: Bool //default is true
//Sliding options
public var transitionStyle: UIPageViewControllerTransitionStyle = UIPageViewControllerTransitionStyle.Scroll
public var slidingOrientation: UIPageViewControllerNavigationOrientation = UIPageViewControllerNavigationOrientation.Horizontal
public var sliderNavigationDirection: UIPageViewControllerNavigationDirection = UIPageViewControllerNavigationDirection.Forward
iOS 7+
LIHImageSlider is available through CocoaPods. To install it, simply add the following line to your Podfile:
pod 'LIHImageSlider'
v1.0.9
v1.0.6
v1.0.5
Lasith Hettiarachchi, lasithih@yahoo.com
LIHImageSlider is available under the MIT license. See the LICENSE file for more info.