How to differentiate between user swipe and tap action?

后端 未结 2 1929
面向向阳花
面向向阳花 2021-01-21 16:55

I am developing a app in which I have a view which contains subView in it. I want to track both swipe and tap actions such as a single click.

Actions should be tracked

2条回答
  •  悲哀的现实
    2021-01-21 17:17

    The best place to get the information is Defining How Gesture Recognizers Interact of Event Handling Guide for iOS

    When a view has multiple gesture recognizers attached to it, you may want to alter how the competing gesture recognizers receive and analyze touch events. By default, there is no set order for which gesture recognizers receive a touch first, and for this reason touches can be passed to gesture recognizers in a different order each time. You can override this default behavior to:

    • Specify that one gesture recognizer should analyze a touch before another gesture recognizer.
    • Allow two gesture recognizers to operate simultaneously.
    • Prevent a gesture recognizer from analyzing a touch.

提交回复
热议问题