In TextKit Best Practices WWDC lecture, it is mentioned that custom attributes can slow down NSTextView
drawing, and recommends stripping those attributes before sending the string for rendering. I'm using custom attributes which contain tagging data which doesn't get rendered at all.
NSTextStorage
has a method to fix the attributes, but I don't want to remove them altogether. The documentation for Attribute Fixing is a bit vague, and perhaps doesn't even apply in my case.
Which method and which class, NSTextView
, NSTextStorage
or NSLayoutManager
, I can override to control the NSAttributedString
that gets sent for drawing?
I've read the docs to best of my knowledge, and already use custom glyphs etc. successfully, but can't wrap my head around this. In the WWDC keynote, it is skimmed over quickly like it's as simple and easy as anything.