Protocol

UITableViewDropDelegate

The interface for handling drops in a table view.

Overview

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.

Topics

Declaring Support for Handling Drops

func tableView(UITableView, canHandle: UIDropSession)

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

Incorporating the Dropped Data

func tableView(UITableView, performDropWith: UITableViewDropCoordinator)

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

Required.

Tracking the Drag Movements

func tableView(UITableView, dropSessionDidUpdate: UIDropSession, withDestinationIndexPath: IndexPath?)

Proposes how to handle a drop at the specified location in the table view.

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.

Relationships

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.

class UITableViewDropProposal

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

protocol UITableViewDropItem

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

protocol UITableViewDropPlaceholderContext

An object that you insert temporarily into the table view while waiting to receive the actual data that you plan to display.

protocol UIDataSourceTranslating

An advanced interface for managing a data source object.