<!--
{
  "availability" : [
    "iOS: -",
    "iPadOS: -",
    "macCatalyst: -",
    "tvOS: -",
    "visionOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "UIKit",
  "identifier" : "/documentation/UIKit/UITextInput/tokenizer",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Property",
  "symbol" : {
    "kind" : "Instance Property",
    "modules" : [
      "UIKit"
    ],
    "preciseIdentifier" : "c:objc(pl)UITextInput(py)tokenizer"
  },
  "title" : "tokenizer"
}
-->

# tokenizer

An input tokenizer that provides information about the granularity of text units.

```
var tokenizer: any UITextInputTokenizer { get }
```

## Discussion

Standard units of granularity include characters, words, lines, and paragraphs. In most cases, you may lazily create and assign an instance of a subclass of [`UITextInputStringTokenizer`](/documentation/UIKit/UITextInputStringTokenizer) for this purpose. If you require different behavior than this system-provided tokenizer, you can create a custom tokenizer that adopts the [`UITextInputTokenizer`](/documentation/UIKit/UITextInputTokenizer) protocol.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)