filter the candidate while inputing

This commit is contained in:
王劲鹏 2021-06-07 17:14:55 +08:00 committed by osborn
parent b18bec6899
commit 5a9b55c75b

View File

@ -227,6 +227,8 @@ - (BOOL)textViewShouldEndEditing:(UITextView *)textView {
} }
- (void)textViewDidChange:(UITextView *)textView { - (void)textViewDidChange:(UITextView *)textView {
if (textView.markedTextRange) return;
if (self.maxLength) { if (self.maxLength) {
UITextRange *selectedRange = [textView markedTextRange]; UITextRange *selectedRange = [textView markedTextRange];
UITextPosition *pos = [textView positionFromPosition:selectedRange.start offset:0]; UITextPosition *pos = [textView positionFromPosition:selectedRange.start offset:0];