This framework is for SwiftUI.
- iOS 13+
- macOS 10.15+
It is avaiable through Swift Package Manager
The following the the parameters available for users, most of them have default value.
_value: Binding<Double>,
range: ClosedRange<Double>,
step: Double = 0,
outerDiameter: CGFloat = 300,
lineWidth: CGFloat = 50,
endDegrees: Double = 360,
trackColor: Color = Color.blue,
progressColor: Color = Color.green,
dragCircleColor: Color = Color.black,
isDashed: Bool = false,
onValueChangeEnded: (() -> ())? = nil
note: if an invalid value has been set to FWArcSliderView, it will show an empty view. For example, "_value" has been set to out of the "range".
@State private var value = 6.0
ZStack {
FWArcSliderView(
$value,
range: 0...10
)
Text("\(String(format: "%.2f", value))")
}
@State private var value = 6.0
ZStack {
FWArcSliderView(
$value,
range: 0...10,
step: 1
)
Text("\(String(format: "%.2f", value))")
}
@State private var value = 6.0
ZStack {
FWArcSliderView(
$value,
range: 0...10,
step: 1,
endDegrees: 180,
isDashed: true
)
Text("\(String(format: "%.0f", value))")
}
Fan Wu, [email protected]
It is available under the MIT license. See the LICENSE file for more info.