---
title: UITextInputTokenizer
framework: uikit
role: symbol
role_heading: Protocol
path: uikit/uitextinputtokenizer
---

# UITextInputTokenizer

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

## Declaration

```swift
@MainActor protocol UITextInputTokenizer : NSObjectProtocol
```

## Overview

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 (through 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:)](uikit/uitextinputtokenizer/isposition(_:atboundary:indirection:).md)
- [isPosition(_:withinTextUnit:inDirection:)](uikit/uitextinputtokenizer/isposition(_:withintextunit:indirection:).md)

### Computing text position by unit boundaries

- [position(from:toBoundary:inDirection:)](uikit/uitextinputtokenizer/position(from:toboundary:indirection:).md)

### Getting ranges of specific text units

- [rangeEnclosingPosition(_:with:inDirection:)](uikit/uitextinputtokenizer/rangeenclosingposition(_:with:indirection:).md)

### Constants

- [UITextDirection](uikit/uitextdirection.md)
- [UITextGranularity](uikit/uitextgranularity.md)

## Relationships

### Inherits From

- [NSObjectProtocol](objectivec/nsobjectprotocol.md)

### Conforming Types

- [UITextInputStringTokenizer](uikit/uitextinputstringtokenizer.md)

## See Also

### Text tokenizer

- [UITextInputStringTokenizer](uikit/uitextinputstringtokenizer.md)
