From d834336b3c14732b85629de4262e91a1c44ea2f8 Mon Sep 17 00:00:00 2001 From: "pengfei.zhou" Date: Tue, 8 Jun 2021 18:20:37 +0800 Subject: [PATCH] iOS: code optimize,delete useless code --- doric-iOS/Pod/Classes/Shader/DoricInputNode.m | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/doric-iOS/Pod/Classes/Shader/DoricInputNode.m b/doric-iOS/Pod/Classes/Shader/DoricInputNode.m index 925a161a..691ce60e 100644 --- a/doric-iOS/Pod/Classes/Shader/DoricInputNode.m +++ b/doric-iOS/Pod/Classes/Shader/DoricInputNode.m @@ -228,13 +228,9 @@ - (BOOL)textViewShouldEndEditing:(UITextView *)textView { - (void)textViewDidChange:(UITextView *)textView { if (textView.markedTextRange) return; - + if (self.maxLength) { - UITextRange *selectedRange = [textView markedTextRange]; - UITextPosition *pos = [textView positionFromPosition:selectedRange.start offset:0]; - if (!pos) { - textView.text = [self limitToHansMaxLength:self.maxLength.unsignedIntValue text:textView.text]; - } + textView.text = [self limitToHansMaxLength:self.maxLength.unsignedIntValue text:textView.text]; } if (self.onTextChange) { self.onTextChange(textView.text, self);