22. Introduction to TextKit

Both the iPhone and, later, the iPad have supported numerous text presentation elements from their inception. Text fields, labels, text views, and Web views have been with the OS since its release. Over time these classes have been expanded and improved with the goal of giving developers more flexibility and power with regard to text rendering.

In the early days of iOS (then called iPhone OS), the only practical way to display attributed text was to use a UIWebView and use HTML to render custom attributes; however, this was difficult to implement and carried with it terrible performance. iOS 3.2 introduced Core Text, which brought the full power of NSAttributedString to the mobile platform from the Mac. Core Text, ...

Get Mastering iOS Frameworks: Beyond the Basics, Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.