I am trying to do something similar to the one in this link http://www.oracle.com/webfolder/ux/mobile/pattern/img/expand-collpase-description.png
Expanding the content i
I'm not sure exactly how Apple implements it, but I can almost guarantee that it isn't a subview of the UITextView. How I would implement this feature would be to set up a custom container view for the UITextView. Set the default height for the container, and then if the UITextView's height is greater than the container view's height, display a more UIButton in the buttom right (or left, or top right, or wherever you want, bottom left seems to make the most sense) that simply animates the height of the container view to fit the UITextView.
If you really wanted to make it all in just a textview, I suppose you would have to subclass it to provide that kind of custom functionality, but someone else may know a way to do this all without subclassing UITextView. My approach would be the one described above.
I'm doing the same thing. Just add the button to textView.superView, because textView is scrollView. Use button's rect in textView as
textView.textContainer.exclusionPaths = [UIBezierPath(rect: rect)]
At last, I did it. Most important thing is rect
must be included in textView.frame
.