iOS: code optimize,delete useless code
This commit is contained in:
parent
23a39f20fc
commit
d834336b3c
@ -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);
|
||||
|
Reference in New Issue
Block a user