Meet TextKit 2

RSS for tag

Discuss the WWDC21 session Meet TextKit 2.

View Session

Posts under wwdc21-10061 tag

23 Posts
Sort by:
Post not yet marked as solved
0 Replies
419 Views
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)
Posted Last updated
.
Post not yet marked as solved
0 Replies
317 Views
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
Posted
by MainasuK.
Last updated
.
Post not yet marked as solved
1 Replies
426 Views
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.
Posted
by MainasuK.
Last updated
.