A very unfashionable UISlider component for iOS apps, with snapping behaviour.
BDSteppedSlider
is a "Classic macOS" inspired value-slider, which can be used in-place of standard UISlider
. Why? Because! That's why!
It is as performant as possible, but serves no real purpose other than to be extremely unfashionable. Have fun!
- It also includes a more modern style.
- "Snap"
- The slider can be configured to move in whole numbers.
- Dragging the slider between two marks and letting go, will move the slider to the nearest allowed value.
- "Quick Tap"
- Tap anywhere on the slider track, and the knob will move to the mark stop nearest your touch position.
- Animates!
- Supports the "Taptic" feedback engine.
- *May be unavailable on some iOS devices
- Delegate Callback
BDSteppedSlider
works like any bog-standard UISlider, with added functionality.
@IBOutlet private weak var slider: BDSteppedSlider!
When the value gets changed, BDSteppedSlider
sends a message to attached listeners.
extension SomeViewController: BDSteppedSliderDelegate {
func steppedSlider(_ slider: BDSteppedSlider, valueChanged newValue: Float) {
print(newValue)
}
}
BDSteppedSlider
works wherever this version of Swift will compile.
Download the repo and add it into your Xcode project.
pod 'BDSteppedSlider'
No reason. Have fun!
BDSteppedSlider
was created by Benjamin Deckys
BDSteppedSlider
is available under the MIT license. Please see the LICENSE file for more information.