What's new in TextKit and text views

RSS for tag

Discuss the WWDC22 Session What's new in TextKit and text views

Posts under wwdc2022-10090 tag

7 Posts
Sort by:
Post not yet marked as solved
3 Replies
140 Views
In TextKit 1, I can override drawBackground(forGlyphRange:at:) in NSLayoutManager to do custom background drawing. However, I'm not too sure what the designated way of doing background drawing is in TextKit 2. One thing I've tried is to do custom drawing in my own CALayer that's used in the configureRenderingSurface delegate callback, but I'm unsure if we are suppose to use this API and steal the textViewportLayoutController.delegate away from _UITextLayoutcanvasView?
Posted Last updated
.
Post not yet marked as solved
0 Replies
112 Views
Hi TextKit 2 Team, I'm trying to configure my own custom rendering surface when using UITextView(usingTextLayoutManager: true). What I'm currently doing is adding a "contentLayer: CALayer" into my UITextView and adding my rendering surfaces into that. The issue I'm running into, is that the rendering surface will display the first character I input, but then will not update for subsequent text until: It becomes long enough to cause a line wrap. I hit return. Not sure if I'm doing something wrong? So my questions are: Is using configureRenderingSurface API intended to be used when I'm using UITextView? Or it's only meant for when I do fully custom InputView? Should I be inserting my rendering surfaces into my contentLayer or is there some more appropriate place for me to insert into? How do I properly trigger redraw or invalidation of my rendering surface on text editing changes? Is this a bug or do I have to trigger an update manually somewhere? Many thanks in advance!
Posted Last updated
.
Post not yet marked as solved
1 Replies
135 Views
Hi TextKit team, How do I access the textContentStorage of UITextView that is usingTextLayoutManager: true? I'd like to use the NSTextContentStorageDelegate methods, but unlike NSTextView where it has a property for textContentStorage, it seems UITextView doesn't expose this? Thanks for your help in advance! Cheers / Leo
Posted Last updated
.
Post not yet marked as solved
1 Replies
132 Views
Hi TextKit2 Team, I'm trying to find the link to download the TextKitAndTextView sample code that was mentioned in the "What's new in TextKit and text views" video. I can't seem to find a link to it anywhere though. Cheers / Leo
Posted Last updated
.
Post marked as solved
1 Replies
220 Views
It's a simple question. I'm just trying to understand how these things fit together. Core Text doesn't seem to get updated much, but maybe that's because it's low level and doesn't need it. I assume it's still the recommended way to do low-level text things not handled by TextKit. ?
Posted
by rnikander.
Last updated
.