Apple Text Layout & Multi-Column Wrap
Implements advanced text wrapping, multi-column layouts, and non-rectangular text regions for Apple's TextKit framework.
This skill provides comprehensive guidance for mastering complex text layouts in iOS and macOS applications using TextKit 1 and TextKit 2. It enables developers to implement sophisticated magazine-style layouts, wrap text around custom shapes using exclusion paths, and manage multi-container flows for paginated or side-by-side content. It also covers the intricacies of coordinate systems, table implementation (including UIKit fallbacks), and custom NSTextContainer subclasses to achieve high-performance, non-rectangular text rendering while avoiding common pitfalls like coordinate offsets and layout invalidation overhead.
主な機能
01Advanced text wrapping around arbitrary shapes using UIBezierPath exclusion paths
02Custom non-rectangular text containers via lineFragmentRect overrides
03Implementation of in-text tables and lists using NSTextTable and NSTextList
04Multi-column and magazine-style layout implementation for fluid text flow across containers
05Coordinate system mapping between text views and text containers
060 GitHub stars
ユースケース
01Creating custom text editors that require text to conform to circular or irregular geometric shapes
02Building a magazine-style app where text flows around high-resolution images and pull quotes
03Developing a multi-column e-book reader or documentation viewer with paginated layout