Contents

UITextItem

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

Declaration

@MainActor class UITextItem

Overview

A text item represents a link with a URL destination, a custom tag for a topic that you specify in your app, or a text attachment in a text view. In your text view’s UITextViewDelegate, implement textView(_:primaryActionFor:defaultAction:) to provide a custom action when someone interacts with a text item. Implement textView(_:menuConfigurationFor:defaultMenu:) to provide a custom menu for a text item.

Topics

Specifying the content type

Specifying the range

Creating a menu

See Also

Text actions and menus