@@ -14,9 +14,18 @@ @implementation CCInputView
14
14
@synthesize myMarkedText;
15
15
@synthesize isKeyboardShown;
16
16
17
+ @synthesize hasText;
18
+ @synthesize selectedTextRange;
19
+ @synthesize beginningOfDocument;
20
+ @synthesize endOfDocument;
21
+ @synthesize markedTextStyle;
22
+ @synthesize tokenizer;
23
+ @synthesize autocorrectionType;
24
+
17
25
- (instancetype ) initWithFrame : (CGRect)frame {
18
26
if (self = [super initWithFrame: frame] ) {
19
27
self.myMarkedText = nil ;
28
+ self.autocorrectionType = UITextAutocorrectionTypeNo;
20
29
}
21
30
22
31
return self;
@@ -35,14 +44,14 @@ - (void)didMoveToWindow
35
44
[[NSNotificationCenter defaultCenter ] addObserver: self
36
45
selector: @selector (onUIKeyboardNotification: )
37
46
name: UIKeyboardWillShowNotification object: nil ];
38
-
47
+
39
48
[[NSNotificationCenter defaultCenter ] addObserver: self
40
49
selector: @selector (onUIKeyboardNotification: )
41
50
name: UIKeyboardDidShowNotification object: nil ];
42
51
[[NSNotificationCenter defaultCenter ] addObserver: self
43
52
selector: @selector (onUIKeyboardNotification: )
44
53
name: UIKeyboardWillHideNotification object: nil ];
45
-
54
+
46
55
[[NSNotificationCenter defaultCenter ] addObserver: self
47
56
selector: @selector (onUIKeyboardNotification: )
48
57
name: UIKeyboardDidHideNotification object: nil ];
@@ -62,6 +71,14 @@ - (void)touchesCancelled:(NSSet *)touches withEvent:(UIEvent *)event
62
71
63
72
#pragma TextInput protocol
64
73
74
+ - (id <UITextInputDelegate>)inputDelegate {
75
+ return nil ;
76
+ }
77
+
78
+ - (void )setInputDelegate : (id <UITextInputDelegate>)inputDelegate {
79
+
80
+ }
81
+
65
82
- (void )deleteBackward {
66
83
if (nil != self.myMarkedText ) {
67
84
[self .myMarkedText release ];
@@ -178,7 +195,7 @@ - (nullable NSString *)textInRange:(nonnull UITextRange *)range {
178
195
if (nil != self.myMarkedText ) {
179
196
return self.myMarkedText ;
180
197
}
181
- return nil ;
198
+ return @" " ;
182
199
}
183
200
184
201
- (nullable UITextRange *)textRangeFromPosition : (nonnull UITextPosition *)fromPosition toPosition : (nonnull UITextPosition *)toPosition {
@@ -327,6 +344,4 @@ - (void)onUIKeyboardNotification:(NSNotification *)notif
327
344
}
328
345
}
329
346
330
- @synthesize hasText;
331
-
332
347
@end
0 commit comments