Multi-line/Autoresizing UITextView similar to SMS-app. The example project also even looks like Apple's version.
int maxNumberOfLines;
– Stops growing at this amount of lines.int minNumberOfLines;
– Starts growing at this amount of lines.BOOL animateHeightChange;
– Animate the growing
UITextView properties
NSString *text;
UIFont *font;
UIColor *textColor;
UITextAlignment textAlignment;
NSRange selectedRange;
BOOL editable;
UIDataDetectorTypes dataDetectorTypes;
UIReturnKeyType returnKeyType;
-(BOOL)growingTextViewShouldBeginEditing:(HPGrowingTextView *)growingTextView;
-(BOOL)growingTextViewShouldEndEditing:(HPGrowingTextView *)growingTextView;
-(void)growingTextViewDidBeginEditing:(HPGrowingTextView *)growingTextView;
-(void)growingTextViewDidEndEditing:(HPGrowingTextView *)growingTextView;
-(BOOL)growingTextView:(HPGrowingTextView *)growingTextView shouldChangeTextInRange(NSRange)range replacementText:(NSString *)text;
-(void)growingTextViewDidChange:(HPGrowingTextView *)growingTextView;
Called WITHIN animation block!
-(void)growingTextView:(HPGrowingTextView *)growingTextView willChangeHeight:(float)height;
Called after animation
-(void)growingTextView:(HPGrowingTextView *)growingTextView didChangeHeight:(float)height;
-(void)growingTextViewDidChangeSelection:(HPGrowingTextView *)growingTextView;
-(BOOL)growingTextViewShouldReturn:(HPGrowingTextView *)growingTextView;
This project is not yet ARC-supported. You should add -fno-objc-arc
as a compiler flag for the files. See: http://stackoverflow.com/questions/6646052/how-can-i-disable-arc-for-a-single-file-in-a-project
For more info, see blogpost: http://www.hanspinckaers.com/multi-line-uitextview-similar-to-sms