Drag and Drop Customization
Extend the standard drag and drop support for text views to include custom types of content.
Overview
The UITextField
and UITextView
classes provide built-in support for dragging and dropping text and images. You can extend this support to your own custom data types by adding a text drag delegate or text drop delegate to your views. Your text drag delegate adopts the UITextDragDelegate
protocol and is responsible for providing the items to be dragged. Your text drop delegate adopts the UITextDropDelegate
protocol and handles drops containing items with your custom data types.
Topics
Text View Additions
UITextDragDelegate
The interface for customizing the behavior of a drag activity for a text view.
UITextDraggable
The interface that determines if a text view is a drag source.
UITextDragOptions
A set of options that determine the behavior of a draggable text view.
UITextDroppable
The interface that determines if a text view is a drop destination.
Drag Content
UITextDragRequest
The interface for describing the attributes of a drag activity originating in a text view.
Drop Management
UITextDropRequest
The interface for specifying the attributes of a drop request for a text view.
Pasteboard Support
UITextPasteItem
The interface for obtaining information about, and interacting with, a text item for pasting or dropping.
UITextPasteDelegate
The interface for handling pasting and dropping of text, using item providers.
See Also
Text Views
UILabel
A view that displays one or more lines of read-only text, often used in conjunction with controls to describe their intended purpose.
UITextField
An object that displays an editable text area in your interface.