Pan gesture interferes with UISlider

前端 未结 2 946
时光说笑
时光说笑 2020-12-20 12:01

I\'m trying to create a sliding menu (kind of like in Facebook/Twitter apps) and my version successfully uses pan gestures for this effect. The class is called \"SlideMenu\"

相关标签:
2条回答
  • 2020-12-20 12:32

    I also had some issues with it, the source of my problem was that the

    gestureRecogniser.cancelsTouchesInView

    property is true by default, which caused a weird delay effect on my UISlider when tried to drag it. This solved

    gestureRecogniser.cancelsTouchesInView = false

    ps.: also make sure the delaysTouchesBegan, delaysTouchesEnded are set to false

    0 讨论(0)
  • 2020-12-20 12:42

    Basically, in whichever controller or view you are handling the gesture recognizer. When you create the gesture recognizer, you can set its delegate to some object (probably your view controller) and have this object implement the UIGestureRecognizerDelegate. One of the delegate call-backs is gestureRecognizer:shouldReceiveTouch, and so you just have to copy the code you placed above into your object's (view controller's) implementation.

    0 讨论(0)
提交回复
热议问题