Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/maximbilan/swiftlyslider
A simple iOS slider control
https://github.com/maximbilan/swiftlyslider
ios slider swift ui ui-components ui-design ui-kit
Last synced: about 1 month ago
JSON representation
A simple iOS slider control
- Host: GitHub
- URL: https://github.com/maximbilan/swiftlyslider
- Owner: maximbilan
- License: mit
- Created: 2016-06-05T05:44:08.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2019-10-24T07:06:38.000Z (about 5 years ago)
- Last Synced: 2024-10-31T15:58:40.433Z (about 2 months ago)
- Topics: ios, slider, swift, ui, ui-components, ui-design, ui-kit
- Language: Swift
- Homepage:
- Size: 63.5 KB
- Stars: 14
- Watchers: 2
- Forks: 5
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# SwiftlySlider
[![Version](https://img.shields.io/cocoapods/v/SwiftlySlider.svg?style=flat)](http://cocoadocs.org/docsets/SwiftlySlider)
[![License](https://img.shields.io/cocoapods/l/SwiftlySlider.svg?style=flat)](http://cocoadocs.org/docsets/SwiftlySlider)
[![Platform](https://img.shields.io/cocoapods/p/SwiftlySlider.svg?style=flat)](http://cocoadocs.org/docsets/SwiftlySlider)
[![CocoaPods](https://img.shields.io/cocoapods/dt/SwiftlySlider.svg)](https://cocoapods.org/pods/SwiftlySlider)
[![CocoaPods](https://img.shields.io/cocoapods/dm/SwiftlySlider.svg)](https://cocoapods.org/pods/SwiftlySlider)A simple iOS slider control.
![alt tag](https://raw.github.com/maximbilan/SwiftlySlider/master/img/1.png)
## Installation
CocoaPods:
pod 'SwiftlySlider'
Manual:
Just copy the SwiftlySlider.swift into your project.## Using
You can create from Storyboard or XIB. Or create manually:
let slider = SwiftlySlider()For handling changing of values you should implement a protocol SwiftlySliderDelegate:
slider.delegate = selffunc swiftlySliderValueChanged(value: Int) {
}Direction:
picker.direction = SwiftlySlider.PickerDirection.Horizontal // Vertical, HorizontalAlso you can change the current value, the maximum value or the minimum value, for example:
picker.currentValue = 0
picker.maxValue = 30
picker.minValue = 1Slider settings:
sliderImage // Custom an image of the slider
sliderImageOffset // A offset of the custom slider position
sliderSize // A size of the custom slider positionExample:
slider.sliderImage = UIImage(named: "CustomSlider")
slider.sliderImageOffset = CGPoint(x: 0, y: -1)
slider.sliderSize = CGSize(width: 30, height: 15)Normal indicator:
useNormalIndicator // Use a normal indicator
normalValue // A normal valueColor settings:
labelFontColor // A font color of the moving label
labelBackgroundColor // A background color of the moving label
labelFont // A font of the moving label
bgColor // A background colorYou can easily found the example in this repository.
## License
SwiftlySlider is available under the MIT license. See the LICENSE file for more info.