Skip to content

Commit

Permalink
Fix: call -growingTextView:shouldChangeTextInRange:replacementText: i…
Browse files Browse the repository at this point in the history
…n delegate
  • Loading branch information
hboon committed Feb 12, 2013
1 parent 6ac20a7 commit b24b085
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions class/HPGrowingTextView.m
Original file line number Diff line number Diff line change
Expand Up @@ -452,6 +452,12 @@ - (BOOL)textView:(UITextView *)textView shouldChangeTextInRange:(NSRange)range

//weird 1 pixel bug when clicking backspace when textView is empty
if(![textView hasText] && [atext isEqualToString:@""]) return NO;

if ([delegate respondsToSelector:@selector(growingTextView:shouldChangeTextInRange:replacementText:)]) {
if (![delegate growingTextView:self shouldChangeTextInRange:range replacementText:atext]) {
return NO;
}
}

if ([atext isEqualToString:@"\n"]) {
if ([delegate respondsToSelector:@selector(growingTextViewShouldReturn:)]) {
Expand Down

0 comments on commit b24b085

Please sign in to comment.