@@ -668,17 +668,20 @@ - (void)enableActiveViewAccessibility;
668668@end
669669
670670@interface FlutterTimerProxy : NSObject
671- @property (nonatomic , weak ) FlutterTextInputPlugin* target;
671+ @property (nonatomic , readonly , weak ) FlutterTextInputPlugin* target;
672672@end
673673
674674@implementation FlutterTimerProxy
675675
676- + (instancetype )proxyWithTarget : (FlutterTextInputPlugin*)target {
677- FlutterTimerProxy* proxy = [[self alloc ] init ];
678- if (proxy ) {
679- proxy. target = target;
676+ - (instancetype )initWithTarget : (FlutterTextInputPlugin*)target {
677+ self = [[FlutterTimerProxy alloc ] init ];
678+ if (self ) {
679+ _target = target;
680680 }
681- return proxy;
681+ return self;
682+ }
683+ + (instancetype )proxyWithTarget : (FlutterTextInputPlugin*)target {
684+ return [[FlutterTimerProxy alloc ] initWithTarget: target];
682685}
683686
684687- (void )enableActiveViewAccessibility {
@@ -695,7 +698,6 @@ @interface FlutterTextInputPlugin ()
695698@property (nonatomic , retain ) UIView<FlutterTextInputClient>* activeClient;
696699@property (nonatomic , retain ) FlutterTextInputViewAccessibilityHider* inputHider;
697700@property (nonatomic , readonly ) id <FlutterViewResponder> viewResponder;
698- @property (nonatomic , weak ) id <FlutterTextInputDelegate> textInputDelegate;
699701
700702@end
701703
@@ -707,7 +709,6 @@ - (instancetype)initWithDelegate:(id<FlutterTextInputDelegate>)textInputDelegate
707709 self = [super init ];
708710
709711 if (self) {
710- // `_textInputDelegate` is a weak reference because it should retain FlutterTextInputPlugin.
711712 _textInputDelegate = textInputDelegate;
712713 _autofillContext = [[NSMutableDictionary alloc ] init ];
713714 _inputHider = [[FlutterTextInputViewAccessibilityHider alloc ] init ];
0 commit comments