Provides the initial set of items (if any) to drag.
- iOS 11.0+
The collection view from which the drag operation is originating.
The current drag session object.
The index path of the item to drag.
An array of
UIDrag objects containing the details of the items to drag. Return an empty array to prevent the item from being dragged.
You must implement this method to allow the dragging of items from your collection view. In your implementation, create one or more
UIDrag objects for the item at the specified
index. Normally, you return only one drag item, but if the specified item has children or cannot be dragged without one or more associated items, include those items as well.
The collection view calls this method one or more times when a new drag begins within its bounds. Specifically, if the user begins the drag from a selected item, the collection view calls this method once for each item that is part of the selection. If the user begins the drag from an unselected item, the collection view calls the method only once for that item.