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

# UIKeyInput

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

```
@MainActor protocol UIKeyInput : UITextInputTraits
```

## Overview

Adopt this protocol in a subclass of [`UIResponder`](/documentation/UIKit/UIResponder) to support text entry. When instances of this subclass are the first responder, the system keyboard displays. Only a small subset of the available keyboards and languages are available to classes that adopt this protocol.

## Topics

### Inserting and deleting text

[`-  insertText:`](/documentation/UIKit/UIKeyInput/insertText(_:))

Inserts a character into the displayed text.

[`-  deleteBackward`](/documentation/UIKit/UIKeyInput/deleteBackward())

Deletes a character from the displayed text.

[`hasText`](/documentation/UIKit/UIKeyInput/hasText)

A Boolean value that indicates whether the text-entry object has any text.

## Relationships

### Conforming Types

[`UITextView`](/documentation/UIKit/UITextView)

[`UISearchTextField`](/documentation/UIKit/UISearchTextField)

[`UITextField`](/documentation/UIKit/UITextField)

### Inherited By

[`UITextDocumentProxy`](/documentation/UIKit/UITextDocumentProxy)

[`UITextInput`](/documentation/UIKit/UITextInput)

[`UITextDraggable`](/documentation/UIKit/UITextDraggable)

[`UITextDroppable`](/documentation/UIKit/UITextDroppable)

### Inherits From

[`NSObjectProtocol`](/documentation/ObjectiveC/NSObjectProtocol)

[`UITextInputTraits`](/documentation/UIKit/UITextInputTraits)

---

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)