Check if user finished sliding on a continuous UISlider?

前端 未结 4 1542
渐次进展
渐次进展 2021-01-31 07:37

In my app, I have a couple of UISlider instances to change various values. The values are displayed right next to the slider, as well as rendered in a 3d space in another visibl

4条回答
  •  梦如初夏
    2021-01-31 08:23

    In Swift 3:

    @IBAction func sliderValueChanged(_ slider: UISlider, _ event: UIEvent) {
        guard let touch = event.allTouches?.first, touch.phase != .ended else {
            // ended
            return
        }
        // not ended yet
    }
    

提交回复
热议问题