CyanHall.com 创建于 2020-12-23, 上次更新:2021-03-30。
👉  github shields 如果有用请点赞。
    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
}
  
来自 StackOverflow: UISlider with increments of 5
Maitained by Cyanhall.com, Copy Rights @ CC BY-NC-SA 4.0     ExcelRoadMap