UITextView font is nil UITextView font is nil ios ios

UITextView font is nil


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:


I tried changing every property and constraint , I had on my text view.

Including selectable as suggested above

In frustration in the end I deleted and re-added it and that was the unsatisfying fix.


You should try logging self.detailDescriptionLabel. The value might be null.


matomo