Post

Replies

Boosts

Views

Activity

Reply to How to access the textContentStorage of UITextView in iOS 16?
It is a little strange that UITextView doesn't have a convenience property for this. However, you can still access it easily enough via the textLayoutManager's .textContentManager property (NSTextContentStorage being the concrete subclass of NSTextContentManager used by NS/UITextView). And of course you could create an extension to UITextView to add the .textContentStorage property yourself: extension UITextView {     var textContentStorage: NSTextContentStorage? {         return textLayoutManager?.textContentManager as? NSTextContentStorage     } } Hopefully Apple will add this, though, as it would be useful. (I've filed an enhancement request: #FB10376167.)
Topic: App & System Services SubTopic: General Tags:
Jun ’22
Reply to Where is the sample code for TextKitAndTextViewSampleApp?
Here you go: https://developer.apple.com/documentation/uikit/textkit/enriching_your_text_in_text_views There's not much meat in there, unfortunately, and the lists are very buggy (on macOS, try clicking at the end of a line). It also seems there's a lot of stuff not yet available in the first Ventura/Xcode 14 beta. For instance, the NS/UITextView constructor init(usingTextLayoutManager:) seems to be missing.
Topic: App & System Services SubTopic: General Tags:
Jun ’22
Reply to How to access the textContentStorage of UITextView in iOS 16?
It is a little strange that UITextView doesn't have a convenience property for this. However, you can still access it easily enough via the textLayoutManager's .textContentManager property (NSTextContentStorage being the concrete subclass of NSTextContentManager used by NS/UITextView). And of course you could create an extension to UITextView to add the .textContentStorage property yourself: extension UITextView {     var textContentStorage: NSTextContentStorage? {         return textLayoutManager?.textContentManager as? NSTextContentStorage     } } Hopefully Apple will add this, though, as it would be useful. (I've filed an enhancement request: #FB10376167.)
Topic: App & System Services SubTopic: General Tags:
Replies
Boosts
Views
Activity
Jun ’22
Reply to Where is the sample code for TextKitAndTextViewSampleApp?
Here you go: https://developer.apple.com/documentation/uikit/textkit/enriching_your_text_in_text_views There's not much meat in there, unfortunately, and the lists are very buggy (on macOS, try clicking at the end of a line). It also seems there's a lot of stuff not yet available in the first Ventura/Xcode 14 beta. For instance, the NS/UITextView constructor init(usingTextLayoutManager:) seems to be missing.
Topic: App & System Services SubTopic: General Tags:
Replies
Boosts
Views
Activity
Jun ’22