Use drag items to convey data representation promises between a source app and a destination app.
- iOS 11.0+
When a user drags an onscreen visual representation of an item in your app, such as a photo, a Maps location, a Calendar event, or a text selection, your app associates the underlying data with a drag item. The drag item, in turn, uses an item provider. Your app populates the item provider’s
registered array with uniform type identifiers (UTIs).
The array of UTIs constitutes the source app’s promise about the specific data representations it can deliver, on request, to a destination app. The term promise means that, at the time your app constructs a drag item, it commits to providing certain data representations but does not yet perform the work to create them. Although it appears to the user that the item itself is being dragged, the drag item instead consists of promises along with a preview image that remains under the user’s touch point onscreen.
The portion of your app that constructs the drag item is the drag interaction delegate (
UIDrag). On the destination side, an app’s drop interaction delegate (
UIDrop) interacts with the drag item to consume promised data.
This table shows the protocols you implement to support constructing or consuming a drag item, depending on whether a view in your app is acting as a source or destination: