Get the latest tech news

TextKit 2 – The Promised Land


After 4 years with Apple's TextKit 2: The promised 'better' text engine has unstable scrolling, unreliable height estimates, and viewport issues so bad that even Apple's TextEdit suffers from them. Good architecture, but the implementation makes it frustratingly difficult for real-world apps.

Text content manager operates on a series of NSTextElement blocks, but again, the only working implementation must inherit from NSTextParagraph, or you're in trouble (runtime assertions). Viewport is a tool that optimizes text layout engine work and minimizes memory footprint by focusing on the visible area, rather than the entire document, all the time. To make this feature work, it requires various caching, managing intervals, invalidating ranges, and other related tasks; the TextKit 2 framework handles all of that.

Get the Android app

Or read this on Hacker News

Read more on:

Photo of textkit

textkit

Photo of promised land

promised land