iosuigesturerecognizerios13modalviewcontrolleripados13

iOS13/iPadOS13 modal view controller automatic swipe to dismiss break view that captures touch


I found this thread but it doesn't reflect my situation: Disable gesture to pull down form/page sheet modal presentation

I have this problem: My app opens a small view controller via modal presentation in formsheet format. A navigationcontroller is presented which contains a static tableviewcontroller, inside the only cell I have a view that captures a signature via "touchesBegan" and "touchesMoved".

Screenshot

When I try to draw the signature the touch is captured by the view controller which tries to dismiss itself.

Obviously I have activated the property "modalInPresentation"

How do I find the gestureRecognizer responsible for this?

self.view.gestureRecognizers He gives me these back, but nobody seems to intercept the gesture of dismiss:

<UIScrollViewDelayedTouchesBeganGestureRecognizer: 0x280ac8800; state = Possible; enabled = NO; delaysTouchesBegan = YES; view = <UITableView 0x10711a000>; target= <(action=delayed:, target=<UITableView 0x10711a000>)>>
<UIScrollViewPanGestureRecognizer: 0x105bfe170; state = Possible; enabled = NO; delaysTouchesEnded = NO; view = <UITableView 0x10711a000>; target= <(action=handlePan:, target=<UITableView 0x10711a000>)>>
<UIScrollViewKnobLongPressGestureRecognizer: 0x105b9b270; state = Possible; view = <UITableView 0x10711a000>; target= <(action=_handleKnobLongPressGesture:, target=<UITableView 0x10711a000>)>; numberOfTapsRequired = 0; minimumPressDuration = 0.1>
<UIScrollViewKnobLongPressGestureRecognizer: 0x105b9b440; state = Possible; view = <UITableView 0x10711a000>; target= <(action=_handleKnobLongPressGesture:, target=<UITableView 0x10711a000>)>; numberOfTapsRequired = 0>
<UIHoverGestureRecognizer: 0x112fb7f60; state = Possible; view = <UITableView 0x10711a000>; target= <(action=_handleKnobHoverGesture:, target=<UITableView 0x10711a000>)>>
<_UIDragAutoScrollGestureRecognizer: 0x28098ec10; state = Possible; cancelsTouchesInView = NO; delaysTouchesEnded = NO; view = <UITableView 0x10711a000>; target= <(action=_handleAutoScroll:, target=<UITableView 0x10711a000>)>>
<_UISwipeActionPanGestureRecognizer: 0x105be9d00; state = Possible; view = <UITableView 0x10711a000>; target= <(action=_swipeRecognizerDidRecognize:, target=<_UISwipeHandler 0x281896b00>)>>
<_UISwipeDismissalGestureRecognizer: 0x280ac8d00; state = Possible; enabled = NO; delaysTouchesBegan = YES; view = <UITableView 0x10711a000>; target= <(action=_dismissalRecognizerDidRecognize:, target=<_UISwipeHandler 0x281896b00>)>>

Solution

  • I solved it using the researchkit signature. https://github.com/ResearchKit/ResearchKit

    In particular: https://github.com/ResearchKit/ResearchKit/blob/master/ResearchKit/Common/ORKSignatureView.h