Instance Method


Provides the initial set of items (if any) to drag.



- (NSArray<UIDragItem *> *)tableView:(UITableView *)tableView itemsForBeginningDragSession:(id<UIDragSession>)session atIndexPath:(NSIndexPath *)indexPath;



The table view from which the drag operation originated.


The drag session object providing context for the drag operation.


The index path of the row being dragged.

Return Value

An array of UIDragItem objects representing the contents of the specified row. Return an empty array if you do not want the user to drag the specified row.


You must implement this method to allow the dragging of rows from your table view. In your implementation, use the specified indexPath to identify which row is being dragged. In response, create one or more UIDragItem objects representing the content for that row. 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. Return an empty array to indicate that you do not want the specified row to be dragged.

The table view calls this method one or more times when a new drag begins within its bounds. Specifically, it calls the method once for each row that is part of the initial drag. For example, if three rows were selected when the user began the drag operation, the table view calls this method three times. If the user begins a drag operation from an unselected row, this method is called only once for that row.

See Also

Providing the Items to Drag

- tableView:itemsForAddingToDragSession:atIndexPath:point:

Adds the specified items to an existing drag session.

Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software