I've read about this annoying bug on Stackoverflow, where if you don't make your UITextView
selectable, setting the text will cause the font to reset, which is super annoying.
This seems to only work for when setting the normal text
, not attributedText
, because when I set attributedText
it still resets the font, even if I have my the text view set to selectable.
This is really easy to replicate. Create a text view in a storyboard for instance (how I'm doing it), set a font, then set the attributed text to a plain string with myTextView.attributedText = NSAttributedString(string: "Lorem ipsum dolor.")
and it gets reset.
How do I stop this? It's super annoying.