how detect swipe gesture direction?

前端 未结 4 2080
有刺的猬
有刺的猬 2020-12-02 21:06

i need to detect direction of my swipe gesture and i\'ve got problem with it. gesture is working, but i don\'t know how to detect direction. ...

swipeGe         


        
4条回答
  •  再見小時候
    2020-12-02 21:36

    The direction property only defines the allowed directions that are recognized as swipes, not the actual direction of a particular swipe.

    The easiest would be to use two separate gesture recognizers instead. You could also inspect the location of the touch when the gesture starts and when it ends with the locationInView: method.

提交回复
热议问题