Meet TextKit 2

RSS for tag

Discuss the WWDC21 session Meet TextKit 2.

Posts under wwdc21-10061 tag

25 Posts

Post

Replies

Boosts

Views

Activity

Rendering Surface Bounds determination
Good day, simple question. In TextKit2, there seems to be a Rendering Surface Bounds property. We currently have a text.boundingRect(with...) function call to determine some bounding properties, and this is the accepted proposal for most bounding retrieval, but I am not sure the operation is actually the Rendering Surface Bounds of a provided text, as described in the video. So ... let say I have such a text, and I want to get that fully enclosing bounds, what would be my best bet (cross-platform)
0
0
864
Jul ’21
textAttachmentViewProviders always return empty array
The iOS demo app set comment with attachment. However, call the textAttachmentViewProviders on the fragment return nothing even the image attachment draw on the screen. The inline doc is:     // Returns NSTextAttachmentViewProvider associated with the receiver. The property contents are only valid with NSTextLayoutFragmentStateLayoutAvailable.     open var textAttachmentViewProviders: [NSTextAttachmentViewProvider] { get } I have checked the state. The state is available. How can I get the attachment frame when drawing. Thanks
0
0
668
Jul ’21
The method updateContentSizeIfNeeded not set correct size
The iOS demo project using updateContentSizeIfNeeded to get the layout frame and set the content size for text view. However, it looks like the height is not correct. There is always a huge spacer from the last paragraph to scroll view content bottom. (a.k.a calculated frame large than the real frame. I'm trying to use the TextKit 2 to layout the text without scrolling enabled. Should I use the old way NSAttirubtedString's boundingRect or there is some new method to calculate the frame size. Thanks.
1
0
897
Jul ’21
The example project of TextKit 2 did't implement the indented, nested comments like the one shown in the session
Hi there, The example project provided along with the session video doesn't behave like the one shown in the video: the comments are not indented. I couldn't find where the commentDepth value is being used in drawing anywhere. Is it possible to get an updated version with the indentation implemented of this example project? Thanks.
2
0
1.3k
Jul ’21
TextKit 2 viewport
TextKit 2 looks great. The video demonstrates the sample app on both MacOS and iPad. However the downloaded code only works on MacOS and the documentation says the NSTextViewportLayoutController is only available on MacOS, so when can we expect the IOS versions. And what about integration with SwiftUI?
2
0
1.1k
Jul ’21
Rendering Surface Bounds determination
Good day, simple question. In TextKit2, there seems to be a Rendering Surface Bounds property. We currently have a text.boundingRect(with...) function call to determine some bounding properties, and this is the accepted proposal for most bounding retrieval, but I am not sure the operation is actually the Rendering Surface Bounds of a provided text, as described in the video. So ... let say I have such a text, and I want to get that fully enclosing bounds, what would be my best bet (cross-platform)
Replies
0
Boosts
0
Views
864
Activity
Jul ’21
textAttachmentViewProviders always return empty array
The iOS demo app set comment with attachment. However, call the textAttachmentViewProviders on the fragment return nothing even the image attachment draw on the screen. The inline doc is:     // Returns NSTextAttachmentViewProvider associated with the receiver. The property contents are only valid with NSTextLayoutFragmentStateLayoutAvailable.     open var textAttachmentViewProviders: [NSTextAttachmentViewProvider] { get } I have checked the state. The state is available. How can I get the attachment frame when drawing. Thanks
Replies
0
Boosts
0
Views
668
Activity
Jul ’21
The method updateContentSizeIfNeeded not set correct size
The iOS demo project using updateContentSizeIfNeeded to get the layout frame and set the content size for text view. However, it looks like the height is not correct. There is always a huge spacer from the last paragraph to scroll view content bottom. (a.k.a calculated frame large than the real frame. I'm trying to use the TextKit 2 to layout the text without scrolling enabled. Should I use the old way NSAttirubtedString's boundingRect or there is some new method to calculate the frame size. Thanks.
Replies
1
Boosts
0
Views
897
Activity
Jul ’21
The example project of TextKit 2 did't implement the indented, nested comments like the one shown in the session
Hi there, The example project provided along with the session video doesn't behave like the one shown in the video: the comments are not indented. I couldn't find where the commentDepth value is being used in drawing anywhere. Is it possible to get an updated version with the indentation implemented of this example project? Thanks.
Replies
2
Boosts
0
Views
1.3k
Activity
Jul ’21
TextKit 2 viewport
TextKit 2 looks great. The video demonstrates the sample app on both MacOS and iPad. However the downloaded code only works on MacOS and the documentation says the NSTextViewportLayoutController is only available on MacOS, so when can we expect the IOS versions. And what about integration with SwiftUI?
Replies
2
Boosts
0
Views
1.1k
Activity
Jul ’21