iOS: code optimize,delete useless code
This commit is contained in:
parent
23a39f20fc
commit
d834336b3c
@ -230,12 +230,8 @@ - (void)textViewDidChange:(UITextView *)textView {
|
|||||||
if (textView.markedTextRange) return;
|
if (textView.markedTextRange) return;
|
||||||
|
|
||||||
if (self.maxLength) {
|
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) {
|
if (self.onTextChange) {
|
||||||
self.onTextChange(textView.text, self);
|
self.onTextChange(textView.text, self);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user