The interface for handling drops in a table view.


protocol UITableViewDropDelegate


Implement this protocol in the object that you use to incorporate dropped data into your table view. The only required method of this protocol is the tableView(_:performDropWith:) method, but you can implement other methods as needed to customize the drop behavior of your table view.

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


Declaring Support for Handling Drops

func tableView(UITableView, canHandle: UIDropSession) -> Bool

Asks your delegate whether it can accept the specified type of data.

Providing a Custom Drop Preview

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

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

Incorporating the Dropped Data

func tableView(UITableView, performDropWith: UITableViewDropCoordinator)

Incorporates the dropped data into your data structures and updates the table.


Tracking the Drag Movements

func tableView(UITableView, dropSessionDidEnter: UIDropSession)

Called when dragged content enters the table view's bounds rectangle.

func tableView(UITableView, dropSessionDidExit: UIDropSession)

Called when dragged content exits the table view's bounds rectangle.

func tableView(UITableView, dropSessionDidEnd: UIDropSession)

Called to notify you when the drag operation ends.


Inherits From

See Also

Drag and Drop

Supporting Drag and Drop in Table Views

Initiate drags and handle drops from a table view.

protocol UITableViewDragDelegate

The interface for initiating drags from 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.