Autoresizing UITextView

from blog The Desolation of Blog, | ↗ original
My recent blog posts have been more business-y than programmer-y, so today we're going to bring back that codin' feelin'. With a twist, since I'm going to talk about iOS, which is blasphemy in these parts, but don't shout. I'm writing an iOS version of Underpass, and I needed a UITextView that automatically resizes vertically like in Messages. Searching the web reveals that, give or take, a million other developers want this too. Unfortunately, Apple does not provide an API for the behavior, instead forcing developers to figure it out for themselves. As a result, a million developers have produced a million subtly different implementations. The paradox of choice is that I couldn't choose one. To stave off death from both hunger and thirst, I decided to write my own millionth and one implementation.