Post

Replies

Boosts

Views

Activity

Comment on What is the designated way to do custom background drawing in TextKit 2 when using UITextView/NSTextView?
Thanks for the comment. Seems like my notification for replies didn't come. Doing custom drawing in NSTextView's drawBackground(in:) seems like an interesting workaround. Maybe we can use textViewportLayoutController.viewportRange to find the visible ranges? Or do you mean that call is expensive? Haven't done any tests yet, but if drawBackground(in:) gets called after layout, then it might not be, if the testViewportLayoutController does some caching?
Topic: UI Frameworks SubTopic: General Tags:
Jul ’22
Comment on What is the designated way to do custom background drawing in TextKit 2 when using UITextView/NSTextView?
Thanks for the reply. Yeah, going the custom Text View route is one possibility. I kind of toyed around with that as well, but think I should explore the limits of NSTextView a bit further before going full custom.
Topic: UI Frameworks SubTopic: General Tags:
Replies
Boosts
Views
Activity
Jul ’22
Comment on What is the designated way to do custom background drawing in TextKit 2 when using UITextView/NSTextView?
My follow up question would be, where to trigger updates to the NSTextView's drawBackground? Do it in textViewDidChange:notification? or something equivalent to layoutManager:didCompleteLayoutFor:atEnd?
Topic: UI Frameworks SubTopic: General Tags:
Replies
Boosts
Views
Activity
Jul ’22
Comment on What is the designated way to do custom background drawing in TextKit 2 when using UITextView/NSTextView?
Thanks for the comment. Seems like my notification for replies didn't come. Doing custom drawing in NSTextView's drawBackground(in:) seems like an interesting workaround. Maybe we can use textViewportLayoutController.viewportRange to find the visible ranges? Or do you mean that call is expensive? Haven't done any tests yet, but if drawBackground(in:) gets called after layout, then it might not be, if the testViewportLayoutController does some caching?
Topic: UI Frameworks SubTopic: General Tags:
Replies
Boosts
Views
Activity
Jul ’22
Comment on How to access the textContentStorage of UITextView in iOS 16?
Thanks. Forgot that NSTextContentStorage is a concrete subclass of NSTextContentManager. It will be nice if they have it mirror the NSTextView API though. Cheers!
Topic: App & System Services SubTopic: General Tags:
Replies
Boosts
Views
Activity
Jun ’22