Latest | 1.0.5 |
---|---|
Homepage | https://github.com/cloverstudio/CSGrowingTextView |
License | MIT |
Platforms | ios 6.0, requires ARC |
Authors | , |
CSGrowingTextView is a iOS text view that sizes while user types using keyboard.
Usage
You can use it both by code or by Interface Builder, with or without autolayout. Use growDirection to manipulate on what side should CSGrowingTextView grow and growAnimationDuration, growAnimationOptions properties to adjust grow animation.
In case you want your own growing animation implement CSGrowingTextViewDelegate growingTextView:willChangeHeight method and commit animation as following:
// This example uses autolayout
- (void)growingTextView:(CSGrowingTextView *)growingTextView willChangeHeight:(CGFloat)height {
__weak id this = self;
[UIView animateWithDuration:0.25
delay:0.0
options:UIViewAnimationOptionCurveEaseInOut
animations:^{
__strong CSKeyboardViewController *strongThis = this;
strongThis.growingTextViewHeightConstraint.constant = height;
[strongThis.growingTextView setNeedsUpdateConstraints];
[strongThis.growingTextView.superview layoutIfNeeded];
} completion:nil];
}
Installation with CocoaPods
CocoaPods is a dependency manager for Objective-C, which automates and simplifies the process of using 3rd-party libraries like CSGrowingTextView in your projects.
Podfile
platform :ios, '6.0'
pod 'CSGrowingTextView', '~> 1.0'
Latest podspec
{ "name": "CSGrowingTextView", "version": "1.0.5", "summary": "CSGrowingTextView is a iOS text view that sizes while user types using keyboard.", "description": " * CSGrowingTextView was developed in need for text view that sizes while user types.n * It has growing modes so it can resize automatically or leave it to you and is suitable for usage with autolayout.n", "homepage": "https://github.com/cloverstudio/CSGrowingTextView", "license": { "type": "MIT", "file": "LICENSE" }, "authors": { "Clover Developers": "[email protected]", "Josip Bernat": "[email protected]" }, "platforms": { "ios": "6.0" }, "source": { "git": "https://github.com/cloverstudio/CSGrowingTextView.git", "tag": "v1.0.5" }, "source_files": "CSGrowingTextView/CSGrowingTextView/**/*.{h,m}", "requires_arc": true }
Sun, 06 Mar 2016 08:10:03 +0000