Swipe gesture interrupts UISlider control in iOS 13, but not previous iOS versions

前端 未结 4 1026
感情败类
感情败类 2021-01-19 05:37

Note: This is the iOS 13 beta, but also could apply to the official release tomorrow.

Update 2: I replaced it with a larger thumb

4条回答
  •  鱼传尺愫
    2021-01-19 06:21

    SWIFT 5

    The Problem can be solve using delegate method of gesturerecognizer as below

    func gestureRecognizer(_ gestureRecognizer: UIGestureRecognizer, shouldReceive touch: UITouch) -> Bool {
        if touch.view?.isKind(of: UISlider.self) ?? false {
            return false
        } else {
            return true
        }
    }
    

提交回复
热议问题