BFDragGestureRecognizer
BFDragGestureRecognizer copied to clipboard
ignoring touch seems to ignore it all the way up the chain
When setting the frame for the gesture recognizer, there were circumstances that caused all touches to be ignored all the way up the chain.
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!
I am only returning the state as cancelled, not failed. I can send you a sample project if you like.
Please send a sample if you can, thank you.
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 .
I can't find an attachment, sorry.
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.
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.