How to avoid canceling a canceled event?

I have two species, one below the other. I rotate the bottom view, the touch view from above. trying to make a napkin, touches the canceled event, is called before it touches the completed event. When you move your fingers, the events started and affecting the moved events are touched, called, and then touches the completed event, which is called last (mainly). But sometimes, while trying to move slowly, touching a canceled event is called stopping touch events. Therefore, I could not turn the view at a slow speed. What could be the problem? How to avoid touching the canceled event?

Note. I draw some graphs in the views using the core-plot lib.

+8
ios cocoa-touch uitouch touchescancelled
source share
3 answers

If you use any UIGestureRecognizers , they automatically cancel touching other views when they recognize their gesture. You can disable this behavior using the cancelsTouchesInView property of the resolver.

+15
source share

If you are not using the UIGestureReconizer directly, be aware of the grecureRecognizers UITouch properties. I have the same problem and with this code I solve it:

 if (event.type == UIEventTypeTouches) { NSSet* tmpTouches = [event touchesForView:m_PhotoView]; if ([tmpTouches count] == 2) { UITouch *tmpTouch1 = [[tmpTouches allObjects] objectAtIndex:0]; UITouch *tmpTouch2 = [[tmpTouches allObjects] objectAtIndex:1]; if ((tmpTouch1 != nil)&&(tmpTouch2 != nil)) { UIGestureRecognizer * tmpG; if ([tmpTouch1.gestureRecognizers count] > 0) { tmpG = [tmpTouch1.gestureRecognizers objectAtIndex:0]; tmpG.cancelsTouchesInView = NO; } if ([tmpTouch2.gestureRecognizers count] > 0) { tmpG = [tmpTouch2.gestureRecognizers objectAtIndex:0]; tmpG.cancelsTouchesInView = NO; } // Code ... } } } 
+5
source share

See also the UISwipeGestureRecognizer. This caused a problem for me and resolved when we installed

 [recognizer setCancelsTouchesInView:FALSE]; 
0
source share

All Articles