@@ -668,17 +668,20 @@ - (void)enableActiveViewAccessibility;
668
668
@end
669
669
670
670
@interface FlutterTimerProxy : NSObject
671
- @property (nonatomic , weak ) FlutterTextInputPlugin* target;
671
+ @property (nonatomic , readonly , weak ) FlutterTextInputPlugin* target;
672
672
@end
673
673
674
674
@implementation FlutterTimerProxy
675
675
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;
680
680
}
681
- return proxy;
681
+ return self;
682
+ }
683
+ + (instancetype )proxyWithTarget : (FlutterTextInputPlugin*)target {
684
+ return [[FlutterTimerProxy alloc ] initWithTarget: target];
682
685
}
683
686
684
687
- (void )enableActiveViewAccessibility {
@@ -695,7 +698,6 @@ @interface FlutterTextInputPlugin ()
695
698
@property (nonatomic , retain ) UIView<FlutterTextInputClient>* activeClient;
696
699
@property (nonatomic , retain ) FlutterTextInputViewAccessibilityHider* inputHider;
697
700
@property (nonatomic , readonly ) id <FlutterViewResponder> viewResponder;
698
- @property (nonatomic , weak ) id <FlutterTextInputDelegate> textInputDelegate;
699
701
700
702
@end
701
703
@@ -707,7 +709,6 @@ - (instancetype)initWithDelegate:(id<FlutterTextInputDelegate>)textInputDelegate
707
709
self = [super init ];
708
710
709
711
if (self) {
710
- // `_textInputDelegate` is a weak reference because it should retain FlutterTextInputPlugin.
711
712
_textInputDelegate = textInputDelegate;
712
713
_autofillContext = [[NSMutableDictionary alloc ] init ];
713
714
_inputHider = [[FlutterTextInputViewAccessibilityHider alloc ] init ];
0 commit comments