UITextInputStringTokenizer Class Reference

Inherits from
Conforms to
Framework
/System/Library/Frameworks/UIKit.framework
Availability
Available in iOS 3.2 and later.
Declared in
UITextInput.h

Overview

The UITextInputStringTokenizer class is a base implementation of the UITextInputTokenizer protocol provided by the UIKit framework.

If you want to take advantage of this base implementation, you should subclass this class and handle application-specific directions and granularities affected by layout. When you instantiate a class you must supply the document class that is adopting the UITextInput protocol for your application.

Subclassing Notes

When you subclass UITextInputStringTokenizer, override all UITextInputTokenizer methods, calling the superclass implementation (super) when method parameters are not affected by layout. For example, the subclass needs a custom implementation of all methods for line granularity. For the left direction, it needs to decide whether left corresponds at a given position to forward or backward, and then call super passing in the storage direction (UITextStorageDirection).

Tasks

Initializing a Tokenizer

Instance Methods

initWithTextInput:

Returns an object initialized with the document object that directly communicates with the text input system.

- (id)initWithTextInput:(UIResponder < UITextInput > *)textInput
Parameters
textInput

The document object in the application that adopts the UITextInput protocol for the purposes of communicating with the text input system.

Return Value

An instance of a subclass of UITextInputStringTokenizer, or nil if the object couldn’t be created.

Discussion

The subclass of UITextInputStringTokenizer should not retain textInput; the tokenizer should always have a lifetime bounded by that of the UITextInput-conforming object and a retaining reference would create a retain cycle.

Availability
  • Available in iOS 3.2 and later.
Declared In
UITextInput.h