Swiftpack.co -  MTattin/FABoLLValueShowableSlider as Swift Package
Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.
MTattin/FABoLLValueShowableSlider
Show a slider value on the UISlider thumbnail.
.package(url: "https://github.com/MTattin/FABoLLValueShowableSlider.git", from: "1.1.4")

FABoLLValueShowableSlider

You can show a slider value on the UISlider thumbnail.
And you can change a slider value by tap it.

License

MIT

Dependency

  • iOS, >=11
  • Xcode, >= 11

Usage

@IBOutlet weak private var _valueShowableSlider: FABoLLValueShowableSlider!
///
/// Create UILabel
///
let label: UILabel = UILabel.init()
label.backgroundColor = UIColor.clear
label.textColor = UIColor.darkText
label.font = UIFont.systemFont(ofSize: 10.0)
label.adjustsFontSizeToFitWidth = true
label.minimumScaleFactor = 0.5
label.textAlignment = NSTextAlignment.center
///
/// Create settings
///
let settings: FABoLLValueShowableSliderSettings = FABoLLValueShowableSliderSettings.init(
    label: label
)
///
/// Set settings
///
self._valueShowableSlider.setLabel(settings: settings)

If you want to change size:

let settings: FABoLLValueShowableSliderSettings = FABoLLValueShowableSliderSettings.init(
    label: label,
    padding: UIEdgeInsets.init(top: -5.0, left: -4.0, bottom: -3.0, right: -4.0)
)

Full parameters:

let settings: FABoLLValueShowableSliderSettings = FABoLLValueShowableSliderSettings.init(
    label: label,
    isRoundedCorner: true,
    padding: UIEdgeInsets.init(top: 0.0, left: 0.0, bottom: 2.0, right: 0.0),
    valueToString: { (value: Float) in
        return String.init(format: "%d", Int(value * 100)) + "%"
    },
    canChangeTapped: true 
)

GitHub

link
Stars: 0
Last commit: 3 weeks ago

Ad: Job Offers

iOS Software Engineer @ Perry Street Software
Perry Street Software is Jack’d and SCRUFF. We are two of the world’s largest gay, bi, trans and queer social dating apps on iOS and Android. Our brands reach more than 20 million members worldwide so members can connect, meet and express themselves on a platform that prioritizes privacy and security. We invest heavily into SwiftUI and using Swift Packages to modularize the codebase.

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