Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/JellyDevelopment/JDSlider
An iOS Slider written in Swift.
https://github.com/JellyDevelopment/JDSlider
Last synced: 5 days ago
JSON representation
An iOS Slider written in Swift.
- Host: GitHub
- URL: https://github.com/JellyDevelopment/JDSlider
- Owner: JellyDevelopment
- License: mit
- Created: 2016-02-22T22:14:59.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2017-03-24T12:25:17.000Z (over 7 years ago)
- Last Synced: 2024-11-13T11:04:17.746Z (29 days ago)
- Language: Swift
- Homepage:
- Size: 3.43 MB
- Stars: 85
- Watchers: 8
- Forks: 12
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-ios - JDSlider - An iOS Slider written in Swift. (UI / Slider)
- awesome-ios-star - JDSlider - An iOS Slider written in Swift. (UI / Slider)
README
# JDSlider
[![Version](https://img.shields.io/cocoapods/v/JDSlider.svg?style=flat)](http://cocoapods.org/pods/JDSlider)
[![License](https://img.shields.io/cocoapods/l/JDSlider.svg?style=flat)](http://cocoapods.org/pods/JDSlider)
[![Platform](https://img.shields.io/cocoapods/p/JDSlider.svg?style=flat)](http://cocoapods.org/pods/JDSlider)![Preview](https://github.com/JellyDevelopment/JDSlider/blob/master/beetripper.gif)
*[Beetripper App's screenshots](http://beetripper.com)*## Example Project
To run the example project, clone the repo, and run `pod install` from the Example directory first.
## Installation
### CocoaPods
JDSlider is available through [CocoaPods](http://cocoapods.org). To install
it, simply add the following line to your Podfile:```ruby
pod "JDSlider"
```
### ManualClone the repository:
```bash
$ 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.##Usage
* Create an UIView in Interface Builder and change to JDSliderView class.
* Set the Slider's Delegate and Datasource```swift
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
}
}
```
* Implement JDSliderDataSource, JDSliderDelegate```swift
//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
}
```
* You can customize the page indicator's color
```swift
self.sliderView.tintPageIndicator(UIColor.orangeColor(), state: .Highlight)
self.sliderView.tintPageIndicator(UIColor.blackColor(), state: .Normal)
```
## Author* [Jelly Development](https://github.com/JellyDevelopment)
* Juanpe Catalán, [email protected]
* David Carrascal, [email protected]## License
JDSlider is available under the MIT license. See the LICENSE file for more info.