New in iOS 13, three gestures are interpreted as asking for undo and redo:
Double tap with three fingers means undo.
Swipe left with three fingers means undo.
Swift right with three fingers means redo.
Where are the gesture recognizers that detect these gestures? What would I do to override them, turn them off, or arbitrate between them and my own gestures?
Looks like there's a private class called UIUndoGestureRecognizer
that is attached to a UIEditingOverlayGestureView
which lives in a UIInputSetContainerView
inside a UITextEffectsWindow
. (To figure this out, I put a breakpoint inside an UndoManager
's registerUndo
handler and tried swiping left with three fingers, then poked around in the resulting stack trace and assembly code until I found the gesture recognizer instance.)
You could probably use the methods in UIGestureRecognizerDelegate
to arbitrate between your gesture recognizers and these system ones, and you could override editingInteractionConfiguration
in your view controller or view to return .none
in order to just turn them off completely.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With