Text Storage

Manage text storage, and coordinate the layout of text.

Topics

Data

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.

Metrics

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.

Paragraphs

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.

Attachments

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

func NSTextAlignmentToCTTextAlignment(NSTextAlignment)

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

func NSTextAlignmentFromCTTextAlignment(CTTextAlignment)

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

See Also

Text

Text Display and Fonts

Use UIKit views to display text, manage fonts, and check spelling.

Keyboards and Input

Configure the system keyboard, or create your own keyboards and handle input yourself.