Contents

UITextDocumentProxy

An object that provides textual context to a custom keyboard.

Declaration

@MainActor protocol UITextDocumentProxy : UIKeyInput

Mentioned in

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 Creating a custom keyboard.

Topics

Getting the text-input mode

Obtaining textual context around the insertion point

Adjusting the insertion point position

Getting the selected text

Managing marked text

Distinguishing changes in the document

See Also

Custom keyboard