<!--
{
  "documentType" : "article",
  "framework" : "UIKit",
  "identifier" : "/documentation/UIKit/keyboards-and-input",
  "metadataVersion" : "0.1.0",
  "role" : "collectionGroup",
  "title" : "Keyboards and input"
}
-->

# Keyboards and input

Configure the system keyboard, create your own keyboards to handle input, or detect key presses on a physical keyboard.

## Topics

### Text input

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

A set of methods for interacting with the text input system and enabling features in documents.

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

An intermediary between a document and the text input system.

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

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

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

A set of methods that defines features for keyboard input to a text object.

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

An object that reports the type of input your app receives.

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

The current text input mode.

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

An object that manages custom bar button items that you add to the shortcuts bar above the keyboard on iPad.

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

An object that represents the textual interpretation of a spoken phrase that the user dictates.

### Text interactions

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

An interaction that provides text selection gestures and UI to custom text views.

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

An interface that an object implements to receive information about text interaction events.

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

Modes that determine the selection behaviors that a text interaction provides.

### Custom text selection

[Adopting system selection UI in custom text views](/documentation/UIKit/adopting-system-selection-ui-in-custom-text-views)

Incorporate the system text-selection experience into your custom text UI in UIKit.

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

An object that provides the system UI for displaying text selection.

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

An interface you use to provide a custom highlight UI behind the selected text.

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

An interface you use to draw custom the selection handles for ranges of text.

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

An interface you use to draw the insertion point in a piece of text.

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

A view that draws the standard system insertion point in a piece of text.

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

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

An object that manages the presentation of the system magnifier at the location you specify.

### Text actions and menus

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

An object for attaching custom actions and menus to links, text attachments, or other specific text in a text view.

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

Constants that describe and capture the type of content a text item represents along with a specific related value.

[`MenuConfiguration`](/documentation/UIKit/UITextItem/MenuConfiguration)

An object that describes what type of menu and preview to show for a text item.

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

The methods for receiving editing-related messages for text view objects.

### Smart Reply for messaging

[Adopting Smart Reply in your messaging or email app](/documentation/UIKit/adopting-smart-reply-in-your-messaging-or-email-app)

Generate reply suggestions by using Apple Intelligence and put selected text into your text UI.

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

A base class that represents a conversation between participants, such as in an email or messaging app.

[`Entry`](/documentation/UIKit/UIConversationContext/Entry)

A base class that represents a message in a conversation.

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

A class that represents an email conversation.

[`MailEntry`](/documentation/UIKit/UIMailConversationContext/MailEntry)

A class that represents a specific email in an email thread.

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

A class that represents a message conversation.

[`MessageEntry`](/documentation/UIKit/UIMessageConversationContext/MessageEntry)

A class that represents a message in a message conversation.

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

A base class you use to handle suggestions from the keyboard or system.

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

An input suggestion that carries photo search metadata for people, subjects, locations, and time periods.

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

A class you use to handle a Smart Reply suggestion.

### Text tokenizer

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

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

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

A base implementation of the text-input tokenizer protocol.

### Keyboard layout

[Adjusting your layout with keyboard layout guide](/documentation/UIKit/adjusting-your-layout-with-keyboard-layout-guide)

Respond dynamically to keyboard movement by using the tracking features of the keyboard layout guide.

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

A layout guide that represents the space the keyboard occupies in your app’s layout.

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

A layout guide that automatically activates and deactivates layout constraints depending on its proximity to edges.

### Custom keyboards

[Creating a custom keyboard](/documentation/UIKit/creating-a-custom-keyboard)

Add an extension to your Xcode project to provide systemwide customized text input.

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

The primary view controller for a custom keyboard app extension.

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

An object that displays and manages custom input for a view when that view becomes the first responder.

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

A read-only array of term pairs, each in a lexicon entry object, for a custom keyboard.

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

A read-only term pair, available within a lexicon object, for a custom keyboard.

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

An object that provides textual context to a custom keyboard.

### Physical keyboards

[Handling key presses made on a physical keyboard](/documentation/UIKit/handling-key-presses-made-on-a-physical-keyboard)

Detect when someone presses and releases keys on a physical keyboard.

[Navigating an app’s user interface using a keyboard](/documentation/UIKit/navigating-an-app-s-user-interface-using-a-keyboard)

Navigate between user interface elements using a keyboard and focusable UI elements in iPad apps and apps built with Mac Catalyst.

[Adding hardware keyboard support to your app](/documentation/UIKit/adding-hardware-keyboard-support-to-your-app)

Enhance interactions with your app by handling raw keyboard events, writing custom keyboard shortcuts, and working with gesture recognizers.

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

An object that provides information about the state of a keyboard key.

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

A set of HID usage codes that identify the keys of a USB keyboard.



---

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)