I have a Flutter game and it is not unlikely that a user puts 3 fingers on the screen. iOS 13.0 introduced three finger tap to open an edit menu and three finger swipe left/right to undo/redo. I want to disable this feature for the whole app.
What I learned from Google search results is that this can be controlled by the editingInteractionConfiguration
property that many classes inherit from UIResponder
.
In UIResponder
it is defined like this:
@interface UIResponder : NSObject <UIResponderStandardEditActions>
// ...
// Productivity editing interaction support for undo/redo/cut/copy/paste gestures
@property (nonatomic, readonly) UIEditingInteractionConfiguration editingInteractionConfiguration API_AVAILABLE(ios(13.0));
@end
---
@available(iOS 13.0, *)
public enum UIEditingInteractionConfiguration : Int, @unchecked Sendable {
case none = 0
case `default` = 1 // Default
}
I'm no Swift expert and my attempts to set this to none were adding the override below to my AppDelegate
that inherits from UIResponder
and overriding it in the FlutterViewController
but it did not work:
// Class assigned in main storyboard view controller
class GameFlutterVC:FlutterViewController {
override func viewWillAppear(_ animated: Bool) {
print("This gets printed.");
super.viewWillAppear(animated)
}
// Disable 3 finger tap gesture on iPad (not working)
@available(iOS 13.0, *)
override var editingInteractionConfiguration: UIEditingInteractionConfiguration { .none }
}
(using code from https://www.hackingwithswift.com/example-code/uikit/how-to-disable-undo-redo-copy-and-paste-gestures-using-editinginteractionconfiguration)
Any idea what I am doing wrong?