UITextView returns nil for UITextInput methods when Selectable is set to false from a nib

This was kind of a bear to find. If you create a UITextView from a nib and you have unchecked the iOS 7.0 selectable property then UITextInput protocol methods will return incorrect data, beginningOfDocument will return nil which is something that should probably never happen so will closestPositionToPoint and all of the offset methods will return 0.

Xcode Project With Tests Demonstrating Bug

Comments

John said…
Wow, you just saved me a few hours. Thanks!

As a developer, I really appreciate a lot of the things that Apple does. This is not one of those things.