<!--
{
  "availability" : [
    "iOS: 17.4.0 -",
    "iPadOS: 17.4.0 -",
    "tvOS: 17.4.0 -",
    "visionOS: 1.1.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "BrowserEngineKit",
  "identifier" : "/documentation/BrowserEngineKit/BETextInteraction",
  "metadataVersion" : "0.1.0",
  "role" : "Class",
  "symbol" : {
    "kind" : "Class",
    "modules" : [
      "BrowserEngineKit"
    ],
    "preciseIdentifier" : "c:objc(cs)BETextInteraction"
  },
  "title" : "BETextInteraction"
}
-->

# BETextInteraction

An interaction you add to a text view to support extended text gestures.

```
@MainActor class BETextInteraction
```

## Overview

Add a `BETextInteraction` object to your browser text view’s [`textInputView`](/documentation/BrowserEngineKit/BETextInput/textInputView).
When your browser text view receives text-interaction actions, call the methods on this object to invoke the standard system behavior.

## Topics

### Text selection

[`delegate`](/documentation/BrowserEngineKit/BETextInteraction/delegate)

A delegate object that the interaction notifies when the system changes the text selection.

[`BETextInteractionDelegate`](/documentation/BrowserEngineKit/BETextInteractionDelegate)

A set of methods that informs you about selection changes in text views.

[`textSelectionDisplayInteraction`](/documentation/BrowserEngineKit/BETextInteraction/textSelectionDisplayInteraction)

An interaction that manages the system’s text-selection UI.

[`selectionBoundaryAdjusted(to:touchPhase:flags:)`](/documentation/BrowserEngineKit/BETextInteraction/selectionBoundaryAdjusted(to:touchPhase:flags:))

Notifies the system after the text view adjusts its selection.

[`selectionChangedWithGesture(at:gesture:state:flags:)`](/documentation/BrowserEngineKit/BETextInteraction/selectionChangedWithGesture(at:gesture:state:flags:))

Notifies the system that the text view changed its selection.

### Menus

[`presentEditMenuForSelection()`](/documentation/BrowserEngineKit/BETextInteraction/presentEditMenuForSelection())

Presents an edit menu for the current text selection.

[`dismissEditMenuForSelection()`](/documentation/BrowserEngineKit/BETextInteraction/dismissEditMenuForSelection())

Dismisses the edit menu for the current text selection.

[`contextMenuInteraction`](/documentation/BrowserEngineKit/BETextInteraction/contextMenuInteraction)

An interaction you use to work with the text view’s context menu.

[`contextMenuInteractionDelegate`](/documentation/BrowserEngineKit/BETextInteraction/contextMenuInteractionDelegate)

The delegate for the context menu interaction associated with this text interaction.

### Text replacements

[`addShortcut(forText:from:)`](/documentation/BrowserEngineKit/BETextInteraction/addShortcut(forText:from:))

Presents UI for a person to add a text-replacement shortcut to the keyboard dictionary.

[`showReplacements(forText:)`](/documentation/BrowserEngineKit/BETextInteraction/showReplacements(forText:))

Displays inline text replacements for the current selection.

### Sharing and defining text

[`share(text:from:)`](/documentation/BrowserEngineKit/BETextInteraction/share(text:from:))

Presents standard UI for someone to share text from a browser text view.

[`showDictionary(forTextInContext:definingTextInRange:from:)`](/documentation/BrowserEngineKit/BETextInteraction/showDictionary(forTextInContext:definingTextInRange:from:))

Presents a dictionary definition for the supplied text.

### Translation and transliteration

[`translate(text:from:)`](/documentation/BrowserEngineKit/BETextInteraction/translate(text:from:))

Presents a translation of the text.

[`transliterateChinese(forText:)`](/documentation/BrowserEngineKit/BETextInteraction/transliterateChinese(forText:))

Converts text between traditional and simplified Chinese.

### UI updates

[`editabilityChanged()`](/documentation/BrowserEngineKit/BETextInteraction/editabilityChanged())

Tells the system that the document’s editability status has changed.

[`refreshKeyboardUI()`](/documentation/BrowserEngineKit/BETextInteraction/refreshKeyboardUI())

Tells the system to refresh the keyboard UI.



---

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)