---
title: "init(textInput:)"
framework: uikit
role: symbol
role_heading: Initializer
path: "uikit/uitextinputstringtokenizer/init(textinput:)"
---

# init(textInput:)

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

## Declaration

```swift
init(textInput: any UIResponder & UITextInput)
```

## Parameters

- `textInput`: The document object in the application that adopts the doc://com.apple.uikit/documentation/UIKit/UITextInput protocol for the purposes of communicating with the text input system.

## Return Value

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

## Discussion

Discussion The subclass of UITextInputStringTokenizer shouldn’t 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.
