The interface for initiating drags from a table view.


protocol UITableViewDragDelegate


Implement this protocol in the object that you use to initiate drags from your table view. The only required method of this protocol is the tableView(_:itemsForBeginning:at:) method, but you can implement other methods as needed to customize the drag behavior of your table view.

Assign your custom delegate object to the dragDelegate property of your table view.


Providing the Items to Drag

Tracking the Drag Session

func tableView(UITableView, dragSessionWillBegin: UIDragSession)

Signals the start of a drag operation involving content from the specified table view.

func tableView(UITableView, dragSessionDidEnd: UIDragSession)

Signals the end of a drag operation involving content from the specified table view

func tableView(UITableView, dragSessionIsRestrictedToDraggingApplication: UIDragSession) -> Bool

Returns a Boolean value indicating whether the dragged content must be dropped in the same app.

func tableView(UITableView, dragSessionAllowsMoveOperation: UIDragSession) -> Bool

Returns a Boolean value indicating whether your app supports a move operation for the dragged content.

Providing a Custom Preview

func tableView(UITableView, dragPreviewParametersForRowAt: IndexPath) -> UIDragPreviewParameters?

Returns custom information about how to display the row at the specified location during the drag.


Inherits From

See Also

Drag and Drop

Supporting Drag and Drop in Table Views

Initiate drags and handle drops from a table view.

protocol UITableViewDropDelegate

The interface for handling drops in a table view.

protocol UITableViewDropCoordinator

An interface for coordinating your custom drop-related actions with the table view.

protocol UITableViewDropItem

The data associated with an item being dropped into the table view.

class UITableViewDropProposal

Your proposed solution for handling a drop in a table view.

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