Text Storage

Manage text storage, and coordinate the layout of text.



class NSTextStorage

The fundamental storage mechanism of TextKit.

protocol NSTextStorageDelegate

A set of optional methods implemented by delegates of NSTextStorage objects to handle text-edit processing.

class NSTextContainer

A region where text is laid out.

class NSAttributedString

A string that has associated attributes (such as visual style, hyperlinks, or accessibility data) for portions of its text.


class UITextPosition

A position in a text container—that is, an index into the backing string in a text-display view.

class UITextRange

A range of characters in a text container, identified by a starting index and an ending index in string backing a text-entry object.

class UITextSelectionRect

An encapsulation of information about a selected range of text in a document.


class NSParagraphStyle

The paragraph or ruler attributes used by an attributed string.

class NSMutableParagraphStyle

An object that enables changing the values of the subattributes in a paragraph style attribute.

class NSTextTab

A tab in an NSParagraphStyle object, storing an alignment type and location.


class NSTextAttachment

The values for the attachment attributes of attributed strings and related objects.

protocol NSTextAttachmentContainer

A set of methods that defines the interface to text attachment objects from NSLayoutManager.

Text Manipulations


Converts a UIKit text alignment constant value to the matching constant value used by Core Text.


Converts a Core Text alignment constant value to the matching constant value used by UIKit.

See Also


Text Display and Fonts

Display text, manage fonts, and check spelling.

Keyboards and Input

Configure the system keyboard, create your own keyboards to handle input, or detect key presses on a physical keyboard.