diff --git a/doric-iOS/Pod/Classes/Shader/DoricInputNode.m b/doric-iOS/Pod/Classes/Shader/DoricInputNode.m index 7b02cb13..75954e76 100644 --- a/doric-iOS/Pod/Classes/Shader/DoricInputNode.m +++ b/doric-iOS/Pod/Classes/Shader/DoricInputNode.m @@ -199,7 +199,8 @@ - (BOOL)textViewShouldEndEditing:(UITextView *)textView { - (void)textViewDidChange:(UITextView *)textView { if (self.maxLength) { if (textView.text.length > self.maxLength.unsignedIntValue) { - textView.text = [textView.text substringToIndex:self.maxLength.unsignedIntValue]; + NSRange range = [textView.text rangeOfComposedCharacterSequencesForRange:NSMakeRange(0, self.maxLength.unsignedIntValue)]; + textView.text = [textView.text substringWithRange:range]; } } if (self.onTextChange) {