Swiftpack.co - renderforest/SliderKit as Swift Package

Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.
See all packages published by renderforest.
renderforest/SliderKit 0.0.1
Customizable, multipurpose Sliders for iOS
⭐️ 0
🕓 4 days ago
.package(url: "https://github.com/renderforest/SliderKit.git", from: "0.0.1")

Installation

SliderKit is available through Swift Package Manager

Usage

Initializing

let data = SliderData(
    externalRange: [
        50...79,
        80...120,
        121...200
    ],
    internalRange: [
        0...199,
        200...800,
        801...1000
    ],
    thumbImages: [
        50...64: UIImage(named: "red_thumb")!,
        65...79: UIImage(named: "orange_thumb")!,
        80...120: UIImage(named: "blue_thumb")!,
        121...159: UIImage(named: "orange_thumb")!,
        160...200: UIImage(named: "red_thumb")!
    ]
)
var slider = ScaledSlider(data: data)
slider.tracklineImage = UIImage(named: "track_layer")
slider.debouncesIncrementChanges = true
slider.debouncingDuration = 0.45

Updating slider value

slider.update(sliderValue: value)

OR

slider.changeValue(by: 5)

Callback listeners

slider.onValueChanged = { value in
  print(value)
}
        
slider.onValueUpdated = { value in
  print(value)
}

License

SliderKit is available under the MIT license. See the LICENSE file for more information.

GitHub

link
Stars: 0
Last commit: 4 days ago
jonrohan Something's broken? Yell at me @ptrpavlik. Praise and feedback (and money) is also welcome.

Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco | API | Analytics