BFDragGestureRecognizer icon indicating copy to clipboard operation
BFDragGestureRecognizer copied to clipboard

ignoring touch seems to ignore it all the way up the chain

Open stevenpsmith opened this issue 9 years ago • 7 comments

When setting the frame for the gesture recognizer, there were circumstances that caused all touches to be ignored all the way up the chain.

stevenpsmith avatar May 19 '15 18:05 stevenpsmith

I'm not sure if that would be the correct behavior. Shouldn't touching outside the frame simply be ignored, instead of leading to a gesture failure? ignoreTouch:forEvent: is supposed to ignore the touch only for that particular gesture recognizer, but not influence further handling of the touch by other recognizers or views. What were to circumstances that caused an issue? Could you help me to reproduce them? Thanks!

DrummerB avatar May 19 '15 19:05 DrummerB

I am only returning the state as cancelled, not failed. I can send you a sample project if you like.

stevenpsmith avatar May 19 '15 20:05 stevenpsmith

Please send a sample if you can, thank you.

DrummerB avatar May 19 '15 20:05 DrummerB

Hopefully the attachment works. You should be able to run the sample, try to press the digit label on the second tile, drag and drop down 1 and the scroll view stops scrolling. The code attached has your original version.

On Tue, May 19, 2015 at 4:14 PM Bajee [email protected] wrote:

Please send a sample if you can, thank you.

— Reply to this email directly or view it on GitHub https://github.com/DrummerB/BFDragGestureRecognizer/pull/1#issuecomment-103654897 .

stevenpsmith avatar May 19 '15 20:05 stevenpsmith

I can't find an attachment, sorry.

DrummerB avatar May 19 '15 20:05 DrummerB

I pushed a sample app into my forked repo here: https://github.com/stevenpsmith/BFDragGestureRecognizer

Take a look at the project in the GestureInFrameIssue folder. You probably will need a pod install prior to running it.

stevenpsmith avatar May 20 '15 00:05 stevenpsmith

Thanks!

Okay, so the issue seems to be this line here. The drag recognizer basically prevents the scrollView's pan gesture recognizer to recognize until the drag fails. This is why setting self.state = ..cancelled (which is the same as failed from this point of view) solves the scrolling issue. However I don't think that's what should be happening. A touch outside of the frame should simply not be relevant to the drag gesture and should be ignored in my opinion. Unfortunately I can't quite get it to work like that yet. I'll have to think some more about that. Thanks for pointing this out.

DrummerB avatar May 20 '15 01:05 DrummerB