Created by CyanHall.com
on 12/23/2020
, Last updated: 03/30/2021.
👉 Star me if it’s helpful.
From StackOverflow: UISlider with increments of 5
👉 Star me if it’s helpful.
let step: Float = 5
@IBAction func sliderValueChanged(sender: UISlider) {
let roundedValue = round(sender.value / step) * step
sender.value = roundedValue
// Do something else with the value
}
More