@@ -14,9 +14,18 @@ @implementation CCInputView
1414@synthesize myMarkedText;
1515@synthesize isKeyboardShown;
1616
17+ @synthesize hasText;
18+ @synthesize selectedTextRange;
19+ @synthesize beginningOfDocument;
20+ @synthesize endOfDocument;
21+ @synthesize markedTextStyle;
22+ @synthesize tokenizer;
23+ @synthesize autocorrectionType;
24+
1725- (instancetype ) initWithFrame : (CGRect)frame {
1826 if (self = [super initWithFrame: frame] ) {
1927 self.myMarkedText = nil ;
28+ self.autocorrectionType = UITextAutocorrectionTypeNo;
2029 }
2130
2231 return self;
@@ -35,14 +44,14 @@ - (void)didMoveToWindow
3544 [[NSNotificationCenter defaultCenter ] addObserver: self
3645 selector: @selector (onUIKeyboardNotification: )
3746 name: UIKeyboardWillShowNotification object: nil ];
38-
47+
3948 [[NSNotificationCenter defaultCenter ] addObserver: self
4049 selector: @selector (onUIKeyboardNotification: )
4150 name: UIKeyboardDidShowNotification object: nil ];
4251 [[NSNotificationCenter defaultCenter ] addObserver: self
4352 selector: @selector (onUIKeyboardNotification: )
4453 name: UIKeyboardWillHideNotification object: nil ];
45-
54+
4655 [[NSNotificationCenter defaultCenter ] addObserver: self
4756 selector: @selector (onUIKeyboardNotification: )
4857 name: UIKeyboardDidHideNotification object: nil ];
@@ -62,6 +71,14 @@ - (void)touchesCancelled:(NSSet *)touches withEvent:(UIEvent *)event
6271
6372#pragma TextInput protocol
6473
74+ - (id <UITextInputDelegate>)inputDelegate {
75+ return nil ;
76+ }
77+
78+ - (void )setInputDelegate : (id <UITextInputDelegate>)inputDelegate {
79+
80+ }
81+
6582- (void )deleteBackward {
6683 if (nil != self.myMarkedText ) {
6784 [self .myMarkedText release ];
@@ -178,7 +195,7 @@ - (nullable NSString *)textInRange:(nonnull UITextRange *)range {
178195 if (nil != self.myMarkedText ) {
179196 return self.myMarkedText ;
180197 }
181- return nil ;
198+ return @" " ;
182199}
183200
184201- (nullable UITextRange *)textRangeFromPosition : (nonnull UITextPosition *)fromPosition toPosition : (nonnull UITextPosition *)toPosition {
@@ -327,6 +344,4 @@ - (void)onUIKeyboardNotification:(NSNotification *)notif
327344 }
328345}
329346
330- @synthesize hasText;
331-
332347@end
0 commit comments