I'm trying to implement custom NSTextContentManager
and use it with NSTextView
, however it seems that NSTextView
expect NSTextContentStorage
all the time.
final class MyTextContentManager: NSTextContentManager {
// ...
}
It's added to layout manager, and NSTextView
instance finds it properly:
let textContentManager = MyTextContentManager() textContentManager.addTextLayoutManager(textLayoutManager)
however, when I use it, I see errors at:
[MyTextContentManager textStorage]: unrecognized selector sent to instance 0x600003d84870
the textStorage
property is part of NSTextStorageObserving
, that is not NSTextContentManager
interface.
It looks like NSTextView
is not ready to work with custom NSTextContentManager
. What did I miss?
I don't think NSTextView
/ UITextView
ever gets support for NSTextContentManager. That's one of the reasons I created STTextView, which is a custom TextKit 2 based text view implementation, you may want find useful in that regard.