Post

Replies

Boosts

Views

Activity

Reply to What is the designated way to do custom background drawing in TextKit 2 when using UITextView/NSTextView?
I'm partially answering my own question here. It seems a second option is to do background drawing by overriding NSTextLayoutFragment.draw(at:in:) in a custom subclass of NSTextLayoutFragment and use the NSTextLayoutManagerDelegate.textLayoutManager(:textLayoutFragmentFor:in:) API to return that custom layout fragment to the system. This works fine for custom background drawing, but what if I want some custom interaction using UIView as the rendering surface? This may overlap with another question that I posted relating to the use of configureRenderingSurface with UITextView / NSTextView. Is using configureRenderingSurface kosher when using UITextView / NSTextView? Hopefully someone can give some guidance or clarity on this?
Jun ’22