Is it possible to use UITextView in #TextKit2 with a subclass of NSTextContentManager without using NSTextStorage as backing store?

When I tried this, the app crashed immediately with a requirement to use NSTextContentStorage subclass

Answered by Frameworks Engineer in 718728022

It is not. UITextView requires UITextStorage as a backing (and provides access to it via its textStorage property).

Accepted Answer

It is not. UITextView requires UITextStorage as a backing (and provides access to it via its textStorage property).

Thanks for confirmation.

So basically I have to subclass UIView and implements UITextInput to start with? On Mac, this may mean subclassing NSView and implements NSTextInput / NSTextInputClient?

I won't comment on AppKit (I don't have the background to be reliable), but for UIKit, yes, that should be possible.

Just conforming to NSTextStorageObserving protocol.

Is it possible to use UITextView in #TextKit2 with a subclass of NSTextContentManager without using NSTextStorage as backing store?
 
 
Q