Skip to content

A very unfashionable UISlider component for iOS apps, with stepping behaviour.

License

Notifications You must be signed in to change notification settings

viewDidAppear/BDSteppedSlider

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

BDSteppedSlider

A very unfashionable UISlider component for iOS apps, with snapping behaviour.

BDSteppedSlider_hero

GitHub license Twitter Blog


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.

Features

  • "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

Usage

BDSteppedSlider works like any bog-standard UISlider, with added functionality.

@IBOutlet private weak var slider: BDSteppedSlider!

Delegate

When the value gets changed, BDSteppedSlider sends a message to attached listeners.

extension SomeViewController: BDSteppedSliderDelegate {
  func steppedSlider(_ slider: BDSteppedSlider, valueChanged newValue: Float) {
    print(newValue)
	}
}

Installation & Compatibility

BDSteppedSlider works wherever this version of Swift will compile.

Manual (aka Tried & True)

Download the repo and add it into your Xcode project.

CocoaPods

pod 'BDSteppedSlider'

Why? WHY?

No reason. Have fun!

Credits

BDSteppedSlider was created by Benjamin Deckys

License

BDSteppedSlider is available under the MIT license. Please see the LICENSE file for more information.

About

A very unfashionable UISlider component for iOS apps, with stepping behaviour.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published