Try checking the “selectable” checkbox for this UITextView
in Interface Builder. It’s in the Attributes Inspector. Per @VahramDodoryan’s comment below, you can then set selectable
to false if you don’t want to support selection.
I can’t explain why this works, but it’s probably a UIKit bug. I had an IBOutlet
to a UITextView
whose font property was nil, and it would not respond to any font or text-color changes in code until after its text property had been set. I arrived at this solution through trial-and-error.
If you’re still encountering this issue on recent releases of iOS, consider opening a radar:
- https://openradar.appspot.com/15854592
- https://openradar.appspot.com/15196932