Open antondityativ opened 4 years ago
@HamzaGhazouani could you help me?
It's simple to change value. Value change adding 10
circularSlider.addTarget(self, action: #selector(updateTexts), for: .valueChanged)
@objc func updateTexts() {
let step: CGFloat = 10
let roundedValue = round(circularSlider.endPointValue / step) * step
let value = roundedValue
// same as example code
let ok = (circularSlider.maximumValue / CGFloat(circularSlider.numberOfRounds))
let ff = ceil(value / ok)
maxValueLabel.text = String(format: "%.0f", circularSlider.maximumValue)
minValueLabel.text = String(format: "%.0f", circularSlider.minimumValue)
currentValueLabel.text = String(format: "%.0f", value)
roundsLabel.text = "Round N° " + String(format: "%.0f", ff)
}
Hi! Could you tell me how can I set a step value for the circular slider? Thank you very much!