This library is no longer maintained and is deprecated. The repository might be removed at any point in the future.
An auto-layout based light-weight UITextView subclass which automatically grows and shrinks based on the size of user input and can be constrained by maximal and minimal height - all without a single line of code.
Made primarily for use in Interface builder and only works with Auto layout.
Auto layout is a great way to design your interfaces in a modern iOS application. Certain functionality, however, sometimes can't be achived out-of-the-box. One such example is auto-growing/shrinking UITextView. The problem of this view is that is by default a scrollable view, which means that it's intristic size would not change based on the content. One way around it would be to simply make it unscrollable, however this prevents user to scroll up and down when such element reaches it's maximal height. Thus, MBAutoGrowingTextView was created to work around this problem.
Installation should be done via Cocoa Pods.
Install CocoaPods if you didn't yet:
sudo gem install cocoapods pod setup
Change to the directory of your Xcode project, and Create and Edit your
Podfile and add following line
pod 'MBAutoGrowingTextView', '~> 0.1.0'
Open your project in Xcode from the .xcworkspace file (not the usual project file)
Usage is extremly simple and intuitive if you know your way around Auto Layout. This class leverages Auto-Layout constraints, by changing "height" constraint when needed. It will detect any "height smaller than" or "height greater than" constraints and make sure they are considered when making calculations.