@@ -776,85 +776,6 @@ - (void)setTextInputState:(NSDictionary*)state {
776776 }
777777}
778778
779- // The documentation for presses* handlers (implemented below) is entirely
780- // unclear about how to handle the case where some, but not all, of the presses
781- // are handled here. I've elected to call super separately for each of the
782- // presses that aren't handled, but it's not clear if this is correct. It may be
783- // that iOS intends for us to either handle all or none of the presses, and pass
784- // the original set to super. I have not yet seen multiple presses in the set in
785- // the wild, however, so I suspect that the API is built for a tvOS remote or
786- // something, and perhaps only one ever appears in the set on iOS from a
787- // keyboard.
788-
789- // If you substantially change these presses overrides, consider also changing
790- // the similar ones in FlutterViewController. They need to be overridden in both
791- // places to capture keys both inside and outside of a text field, but have
792- // slightly different implmentations.
793-
794- - (void )pressesBegan : (NSSet <UIPress*>*)presses
795- withEvent : (UIPressesEvent*)event API_AVAILABLE(ios(9.0 )) {
796- if (@available (iOS 13.4 , *)) {
797- for (UIPress* press in presses) {
798- [_textInputDelegate
799- handlePressEvent: [[[FlutterUIPressProxy alloc ] initWithPress: press
800- withEvent: event] autorelease ]
801- nextAction: ^() {
802- [super pressesBegan: [NSSet setWithObject: press] withEvent: event];
803- }];
804- }
805- } else {
806- [super pressesBegan: presses withEvent: event];
807- }
808- }
809-
810- - (void )pressesChanged : (NSSet <UIPress*>*)presses
811- withEvent : (UIPressesEvent*)event API_AVAILABLE(ios(9.0 )) {
812- if (@available (iOS 13.4 , *)) {
813- for (UIPress* press in presses) {
814- [_textInputDelegate
815- handlePressEvent: [[[FlutterUIPressProxy alloc ] initWithPress: press
816- withEvent: event] autorelease ]
817- nextAction: ^() {
818- [super pressesChanged: [NSSet setWithObject: press] withEvent: event];
819- }];
820- }
821- } else {
822- [super pressesChanged: presses withEvent: event];
823- }
824- }
825-
826- - (void )pressesEnded : (NSSet <UIPress*>*)presses
827- withEvent : (UIPressesEvent*)event API_AVAILABLE(ios(9.0 )) {
828- if (@available (iOS 13.4 , *)) {
829- for (UIPress* press in presses) {
830- [_textInputDelegate
831- handlePressEvent: [[[FlutterUIPressProxy alloc ] initWithPress: press
832- withEvent: event] autorelease ]
833- nextAction: ^() {
834- [super pressesEnded: [NSSet setWithObject: press] withEvent: event];
835- }];
836- }
837- } else {
838- [super pressesEnded: presses withEvent: event];
839- }
840- }
841-
842- - (void )pressesCancelled : (NSSet <UIPress*>*)presses
843- withEvent : (UIPressesEvent*)event API_AVAILABLE(ios(9.0 )) {
844- if (@available (iOS 13.4 , *)) {
845- for (UIPress* press in presses) {
846- [_textInputDelegate
847- handlePressEvent: [[[FlutterUIPressProxy alloc ] initWithPress: press
848- withEvent: event] autorelease ]
849- nextAction: ^() {
850- [super pressesCancelled: [NSSet setWithObject: press] withEvent: event];
851- }];
852- }
853- } else {
854- [super pressesCancelled: presses withEvent: event];
855- }
856- }
857-
858779// Extracts the selection information from the editing state dictionary.
859780//
860781// The state may contain an invalid selection, such as when no selection was
0 commit comments