Current version: 1.0.2 [Download]
A collection of custom sliders for SwiftUI.
To use Sliders in a project, add this descriptor to the dependencies
list in your Package.swift
file:
.package(url: "https://github.com/timdubbins/sliders", .exact("1.0.2"))
Alternatively, in Xcode, go to:
File > Add Packages...
and enter
https://github.com/timdubbins/sliders
as the package URL.
@State private var myValue = 30.0
@State private var isEditing = false
var body: some View {
RoundSlider(
"title",
value: $myValue,
in: 10...70,
displayBounds: 0...10,
color: .green) {
isEditing = $0
}
}
@State private var lowValue = 0.0
@State private var highValue = 10.0
@State private var isEditing = false
var body: some View {
VStack {
RangeSlider(
lowValue: $lowValue,
highValue: $highValue,
in: 0...10,
showDifferenceOnEditing: true) {
isEditing = $0
}
Text(String(isEditing))
.foregroundColor(isEditing ? .red : .green)
}
.padding()
}
Happy coding!
link |
Stars: 6 |
Last commit: 1 year ago |
The sliders now use generic binary floating point types. This means you can use them with any floating point data (Float, Double, CGFloat, etc).
Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco | API | Analytics