Contents

TextKit

Manage text storage and perform custom layout of text-based content in your app’s views.

Overview

TextKit provides several classes to control the layout of text, such as NSTextContentStorage, NSTextLayoutManager, and NSTextContainer.

Additionally, TextKit uses NSAttributedString objects extensively. The NSTextStorage class is a subclass of NSMutableAttributedString, and many of the TextKit classes focus on creating complex NSAttributedString instances. Use these classes to specify your text’s format.

Most of the time, you can use TextKit to fine tune the formatting and layout of a UITextView by modifying the view’s textContainer, layoutManager, or textStorage properties. If you need more control, you can also use TextKit to build custom text controls.

Topics

Text management

Formatting and attributes

Content elements

Location and selection

Layout

Attachments

TextKit 1

See Also

Text