Post

Replies

Boosts

Views

Activity

Reply to NSTextLayoutManager giving incorrect fragment frame
NSTextLayoutManager.usageBoundsForTextContainer gives me a wildly inacurrate (much too big) height, and enumerating the documentRange.endLocation Y coordinate in reverse gives me a too small height. Any workarounds for these issues yet? I can't get any reasonable/reliable text height estimation from NSTextLayoutManager. And enumerating in a forward direction is not possible, since if you have lets say 10000 lines, this will destroy performance for a non-contiguous text view since we are always forcing layout of the complete text.
Sep ’24
Reply to Performance Issues with UITextView and TextKit 2
Can't say for iOS, but since it shares the same TextKit codebase as macOS, I can say that scrolling performance degrades significantly above ~3000 lines. 10k lines is an absolute nightmare. That being said, it seems to matter if a text view has line wrap or not. If it has no linewrap, the performance is significantly worse - which is ironic since you would imagine the layout can just assume fixed line heights.
Apr ’24