Skip to content

Instantly share code, notes, and snippets.

@kazimunshimun
Last active September 10, 2020 20:13
Show Gist options
  • Save kazimunshimun/84c0dca324e4bb1ea63cc975bf69724b to your computer and use it in GitHub Desktop.
Save kazimunshimun/84c0dca324e4bb1ea63cc975bf69724b to your computer and use it in GitHub Desktop.
SwiftUI Circular Slider Parts
struct TemperatureControlView: View {
@State var temperatureValue: CGFloat = 0.0
@State var angleValue: CGFloat = 0.0
let config = Config(minimumValue: 0.0,
maximumValue: 40.0,
totalValue: 40.0,
knobRadius: 15.0,
radius: 125.0)
var body: some View {
ZStack {
Circle()
.trim(from: 0.0, to: 0.5)
.stroke(Color.blue, lineWidth: 4)
.frame(width: config.radius * 2, height: config.radius * 2)
.rotationEffect(.degrees(-90))
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment