From bfc0426b83e9d18e527dad16be69da17544503c6 Mon Sep 17 00:00:00 2001 From: muer2000 Date: Mon, 13 Jan 2014 11:37:19 +0800 Subject: [PATCH] add deleteBackward and insertText method add deleteBackward and insertText method --- class/HPGrowingTextView.m | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/class/HPGrowingTextView.m b/class/HPGrowingTextView.m index 9871c6f..236794e 100644 --- a/class/HPGrowingTextView.m +++ b/class/HPGrowingTextView.m @@ -661,6 +661,22 @@ - (void)textViewDidChangeSelection:(UITextView *)textView { } } +- (void)deleteBackward +{ + [self.internalTextView deleteBackward]; + if (![self respondsToSelector:@selector(snapshotViewAfterScreenUpdates:)]) { + [self refreshHeight]; + [self resetScrollPositionForIOS7]; + } +} +- (void)insertText:(NSString *)text +{ + [self.internalTextView insertText:text]; + if (![self respondsToSelector:@selector(snapshotViewAfterScreenUpdates:)]) { + [self refreshHeight]; + [self resetScrollPositionForIOS7]; + } +} @end