Adds the specified items to an existing drag session.
SDKs
- iOS 11.0+
- Mac Catalyst 13.0+
Framework
- UIKit
Declaration
- (NSArray<UIDrag Item *> *)tableView:(UITable View *)tableView itemsForAddingToDragSession:(id<UIDrag Session>)session atIndexPath:(NSIndex Path *)indexPath point:(CGPoint)point;
Parameters
tableView
The table view from which the drag operation originated.
session
The drag session object providing context for the drag operation.
indexPath
The index path of the row being added to the drag operation.
point
The location of the touch that caused the row to be added. This point is in the coordinate space of the table view.
Return Value
An array of UIDrag
objects representing the contents of the specified row. Return an empty array if you do not want the user to add the row to the drag session.
Discussion
Implement this method to allow the user to add items to an active drag session. When a drag session is active and the user taps a row, the table view calls this method. Your implementation should return the drag items to add to the drag operation. If you do not implement this method, additional touches in the table view are handled as normal table view interactions. For example, additional taps cause rows to be selected or deselected.
In your implementation, create one or more UIDrag
objects representing the contents at the specified index path. Normally, you return only one drag item, but you may return more than one item if the specified row represents a container for other content.