Protocol

UITextDocumentProxy

An object that provides textual context to a custom keyboard.

Declaration

@protocol UITextDocumentProxy

Overview

Through conformance to the UIKeyInput protocol, a text document proxy enables a custom keyboard (which is based on the UIInputViewController class) to insert and delete text, to adjust the position of the insertion point, and to determine whether a text input object is empty. The text document proxy uses the keyboard's textDocumentProxy property to do this.

For more about using a text document proxy, see UIInputViewController and Custom Keyboard in App Extension Programming Guide.

Topics

Getting the Text Input Mode

documentInputMode

The text input mode to use for the keyboard.

Required.

Obtaining Textual Context Around the Insertion Point

documentContextAfterInput

Textual context after the insertion point in the current text input object.

Required.

documentContextBeforeInput

Textual context before the insertion point in the current text input object.

Required.

Adjusting the Insertion Point Position

- adjustTextPositionByCharacterOffset:

Moves the insertion point forward or backward in the current text input object.

Required.

Getting the Selected Text

selectedText

The currently selected text in the document.

Required.

Distinguishing Changes in the Document

documentIdentifier

The unique identifier for this document.

Required.

Instance Methods

Relationships

Inherits From

See Also

Custom Keyboard

UIInputViewAudioFeedback

A property that enables a custom input or keyboard accessory view to play standard keyboard input clicks.

UIInputViewController

The primary view controller for a custom keyboard app extension.

UILexicon

A read-only array of term pairs, each in a lexicon entry object, for use by a custom keyboard.

UILexiconEntry

A read-only term pair, available within a lexicon object, for use by a custom keyboard.

Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software