<!--
{
  "documentType" : "article",
  "framework" : "BrowserEngineKit",
  "identifier" : "/documentation/BrowserEngineKit/support-extended-text-interactions",
  "metadataVersion" : "0.1.0",
  "role" : "article",
  "title" : "Supporting extended text interactions"
}
-->

# Supporting extended text interactions

Share content, add replacement shortcuts, and perform other rich actions in browser text views.

## Overview

When your browser’s text view conforms to the [`BETextInput`](/documentation/BrowserEngineKit/BETextInput) protocol, it automatically also conforms to [`BEResponderEditActions`](/documentation/BrowserEngineKit/BEResponderEditActions).
This protocol adds a collection of optional action methods your text view can implement to support extended text interactions.

To get the system’s standard behavior for an interaction, add a [`BETextInteraction`](/documentation/BrowserEngineKit/BETextInteraction) to your custom view’s [`textInputView`](/documentation/BrowserEngineKit/BETextInput/textInputView), and call the interaction’s methods in response to `BEResponderEditActions`.

Additionally, implement [`canPerformAction(_:withSender:)`](/documentation/BrowserEngineKit/BETextInput/canPerformAction(_:withSender:)), to return `true` in situations where the interaction is available, but `false` otherwise.

For example, to share the selected text using the standard share sheet:

```swift
class MyBrowserTextView: UIView, BETextInput, BEResponderEditActions {
  func canPerformAction(_ action: Selector, withSender sender: Any?) -> Bool {
	if (action == #selector(share(_:))) {
	  return self.canShareSelection
	}
  }
  
  func share(_ sender: Any?) {
    self.textInteraction.shareText(self.selectedText, from:self.selectionRect)
  }
}
```

---

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)