Skip to content

Commit

Permalink
(growingTextView:shouldChangeTextInRange:replacementText:) never get …
Browse files Browse the repository at this point in the history
…called.
  • Loading branch information
bretdabaker committed Oct 26, 2011
1 parent 48d27e7 commit 645a67a
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions class/HPGrowingTextView.m
Expand Up @@ -487,6 +487,10 @@ - (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;

//Added by bretdabaker: sometimes we want to handle this ourselves
if ([delegate respondsToSelector:@selector(growingTextView:shouldChangeTextInRange:replacementText:)])
return [delegate growingTextView:self shouldChangeTextInRange:range replacementText:atext];

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

0 comments on commit 645a67a

Please sign in to comment.