Protocol

UITextInputTokenizer

A tokenizer, which is an object that allows the text input system to evaluate text units of different granularities.

Declaration

@protocol UITextInputTokenizer

Overview

Granularities of text units are always evaluated with reference to a storage or reference direction.

Text-processing objects that conform to the UITextInput protocol must hold a reference to a tokenizer (via the tokenizer property). The UITextInputStringTokenizer class provides a default base implementation of the UITextInputTokenizer protocol. Tokenizers of this class are suitable for most western-language keyboards. Apps with different requirements may adopt the UITextInputTokenizer protocol and create their own tokenizers.

Topics

Determining Text Positions Relative to Unit Boundaries

- isPosition:atBoundary:inDirection:

Return whether a text position is at a boundary of a text unit of a specified granularity in a specified direction.

Required.

- isPosition:withinTextUnit:inDirection:

Return whether a text position is within a text unit of a specified granularity in a specified direction.

Required.

Computing Text Position by Unit Boundaries

- positionFromPosition:toBoundary:inDirection:

Return the next text position at a boundary of a text unit of the given granularity in a given direction.

Required.

Getting Ranges of Specific Text Units

- rangeEnclosingPosition:withGranularity:inDirection:

Return the range for the text enclosing a text position in a text unit of a given granularity in a given direction.

Required.

Constants

UITextDirection

A direction of the text.

UITextGranularity

The granularity of a unit of text.

Relationships

Inherits From

See Also

Input

UITextInput

A set of methods you implement to interact with the text input system and enable features such as autocorrection and multistage text input in documents.

UITextInputDelegate

An intermediary between a document and the text input system.

UIKeyInput

A set of methods a subclass of UIResponder uses to implement simple text entry.

UITextInputMode

The current text-input mode.

UITextInputStringTokenizer

A base implementation of the UITextInputTokenizer protocol.

UIDictationPhrase

An object that represents the textual interpretation of a spoken phrase as dictated by a user.

UIInputView

An object that displays and manages custom input for a view when that view becomes the first responder.

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