Is there a way to gain the type of touch gestures that triggered a UIEvent? So, let's say I intercept a gesture with hitTest:withEvent:. How do I identify what kind of touch (pinch, tap, swipe, etc.) happened that triggered this method?
I can gain the type of remote events from the UIEvent subtype, and even if the device was shaken, but there is no parameter for touch events...
How do you identify those?
You need to analysis the touches(the count of touches and there position) yourself. Another easier way is to add corresponding gesture recognizer to get the corresponding type. All touch event's event type is
UIEventSubtypeNone
.You have to do touch analysis on your own.
It is not that difficult, but it is not done for you. Here a sample from some code I am actually using. It is not meant as a full-scale solution. It only detects basic tap/swipe/pinch gestures in a very concrete context (that of my app), and uses a rather uncool mechanism to deliver the gestures (notifications). So, it might apply to your case or more likely not, but I hope it gives you an idea of what is required.