diff --git a/cocos/platform/ios/CCInputView-ios.h b/cocos/platform/ios/CCInputView-ios.h index 84e357d9887c..94b69ff60580 100644 --- a/cocos/platform/ios/CCInputView-ios.h +++ b/cocos/platform/ios/CCInputView-ios.h @@ -1,4 +1,4 @@ #import -@interface CCInputView : UIView +@interface CCInputView : UIView @end diff --git a/cocos/platform/ios/CCInputView-ios.mm b/cocos/platform/ios/CCInputView-ios.mm index e0b884f5e39d..a788535864a0 100644 --- a/cocos/platform/ios/CCInputView-ios.mm +++ b/cocos/platform/ios/CCInputView-ios.mm @@ -14,9 +14,18 @@ @implementation CCInputView @synthesize myMarkedText; @synthesize isKeyboardShown; +@synthesize hasText; +@synthesize selectedTextRange; +@synthesize beginningOfDocument; +@synthesize endOfDocument; +@synthesize markedTextStyle; +@synthesize tokenizer; +@synthesize autocorrectionType; + - (instancetype) initWithFrame:(CGRect)frame { if (self = [super initWithFrame:frame] ) { self.myMarkedText = nil; + self.autocorrectionType = UITextAutocorrectionTypeNo; } return self; @@ -35,14 +44,14 @@ - (void)didMoveToWindow [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(onUIKeyboardNotification:) name:UIKeyboardWillShowNotification object:nil]; - + [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(onUIKeyboardNotification:) name:UIKeyboardDidShowNotification object:nil]; [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(onUIKeyboardNotification:) name:UIKeyboardWillHideNotification object:nil]; - + [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(onUIKeyboardNotification:) name:UIKeyboardDidHideNotification object:nil]; @@ -62,6 +71,14 @@ - (void)touchesCancelled:(NSSet *)touches withEvent:(UIEvent *)event #pragma TextInput protocol +- (id)inputDelegate { + return nil; +} + +- (void)setInputDelegate:(id)inputDelegate { + +} + - (void)deleteBackward { if (nil != self.myMarkedText) { [self.myMarkedText release]; @@ -178,7 +195,7 @@ - (nullable NSString *)textInRange:(nonnull UITextRange *)range { if (nil != self.myMarkedText) { return self.myMarkedText; } - return nil; + return @""; } - (nullable UITextRange *)textRangeFromPosition:(nonnull UITextPosition *)fromPosition toPosition:(nonnull UITextPosition *)toPosition { @@ -327,6 +344,4 @@ - (void)onUIKeyboardNotification:(NSNotification *)notif } } -@synthesize hasText; - @end