I am using a UIPinchGestureRecognizer, which uses 2 fingers by default. If a user decides to perform the multitask gesture, the pinch gestures action is also activated.
Is there a way to cancel the pinch gesture from occurring if more than four UITouch instances are detected?
Edit Removed sample code as it was the wrong approach.
With a multitask gesture, the
numberOfTouches
returned by theUIPinchGestureRecognizer
is 2 instead of 4 or 5, because some touches are ignored.You can subclass
UIPinchGestureRecognizer
and overrideignoreTouch:forEvent
to cancel the recognizer if the event has 4 or 5 touches: