TestsTested | ✗ |
LangLanguage | SwiftSwift |
License | MIT |
ReleasedLast Release | Feb 2016 |
SPMSupports SPM | ✗ |
Maintained by Juanpe Catalán, David López Carrascal.
To run the example project, clone the repo, and run pod install
from the Example directory first.
Clone the repository:
$ git clone https://github.com/JellyDevelopment/JDSlider.git
Drag and drop JDSlider.swift
file into your project. Add import JDSlider
to all view controllers that need to use it.
class ViewController: UIViewController, JDSliderDataSource, JDSliderDelegate {
//MARK: @IBOutlet
@IBOutlet var sliderView: JDSliderView!
//MARK: LifeCycle
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view, typically from a nib.
self.sliderView.delegate = self
self.sliderView.datasource = self
}
}
//MARK: JDSliderDelegate
func slider(jdSlider: JDSliderView, didSelectSlideAtIndex index: Int) {
print("Touch slide with index: \(index)")
}
//MARK: JDSliderDataSource
func slider(jdSliderNumberOfSlides slider: JDSliderView) -> Int {
return self.arrayImages.count
}
func slider(jdSlider: JDSliderView, viewForSlideAtIndex index: Int) -> UIView {
let imageView = UIImageView()
imageView.image = UIImage(named: self.arrayImages[index])
return imageView
}
self.sliderView.tintPageIndicator(UIColor.orangeColor(), state: .Highlight)
self.sliderView.tintPageIndicator(UIColor.blackColor(), state: .Normal)
JDSlider is available under the MIT license. See the LICENSE file for more info.