Apple TextKit 2 Reference
Provides expert guidance and implementation patterns for Apple's modern, element-based TextKit 2 text-editing framework.
This skill serves as a comprehensive technical reference for TextKit 2, Apple's viewport-driven text engine used in modern versions of iOS and macOS. It helps developers implement high-performance text editing features by providing deep insights into the element-based content model, layout fragments, and viewport-driven rendering. It is particularly useful when building custom text views, implementing inline Writing Tools features, or bridging existing attributed-string stores into the modern text stack while ensuring thread safety and efficient non-contiguous layout.
Key Features
01Implementation patterns for object-based range handling (NSTextRange and NSTextLocation)
02Optimization strategies for viewport-driven, non-contiguous text layout
03Best practices for rendering attributes versus storage attributes
04Architecture guidance for NSTextContentManager and NSTextLayoutManager
05Fragment enumeration techniques and custom layout fragment delegate hooks
060 GitHub stars
Use Cases
01Developing custom high-performance text editors using the modern TextKit 2 stack
02Integrating Apple's Writing Tools and inline AI features into iOS and macOS applications
03Bridging legacy attributed-string backing stores into the modern element-based text system