steipete / PSPDFTextView

A subclass of UITextView that fixes the most glaring problems from iOS 7 and 7.1.
http://pspdfkit.com
MIT License
873 stars 73 forks source link

Don't scroll while setting the text or selection manually #9

Closed hpique closed 10 years ago

hpique commented 10 years ago

Thanks for open sourcing PSPDFTextView @steipete. It saved me quite a lot of time.

textViewDidChangeSelection: was causing unwanted animations that conflicted with my own. The way I see it, when I’m manually setting the text I don’t want any automatic animations or scroll changes, and I can trigger those manually if I need them.

WARNING: this pull request is not backwards-compatible, as before PSPDFTextView was scrolling to the end* when setting the text and to the end of the selection when setting it. With this commit PSPDFTextView just stays where it is.

* Not exactly the end, as it might be missing to account the textContainerInset. This is most likely is a bug.

steipete commented 10 years ago

Totally missed your PR. This makes sense. Merged. Thanks!

hpique commented 10 years ago

Awesome. Thanks!