Package apple.uikit.protocol
Interface UITableViewDropDelegate
-
public interface UITableViewDropDelegateAPI-Since: 11.0
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default booleantableViewCanHandleDropSession(@NotNull UITableView tableView, @NotNull UIDropSession session)If NO is returned no further delegate methods will be called for this drop session.default @Nullable UIDragPreviewParameterstableViewDropPreviewParametersForRowAtIndexPath(@NotNull UITableView tableView, @NotNull NSIndexPath indexPath)Allows customization of the preview used when dropping to a newly inserted row.default voidtableViewDropSessionDidEnd(@NotNull UITableView tableView, @NotNull UIDropSession session)Called when the drop session completed, regardless of outcome.default voidtableViewDropSessionDidEnter(@NotNull UITableView tableView, @NotNull UIDropSession session)Called when the drop session begins tracking in the table view's coordinate space.default voidtableViewDropSessionDidExit(@NotNull UITableView tableView, @NotNull UIDropSession session)Called when the drop session is no longer being tracked inside the table view's coordinate space.default @NotNull UITableViewDropProposaltableViewDropSessionDidUpdateWithDestinationIndexPath(@NotNull UITableView tableView, @NotNull UIDropSession session, @Nullable NSIndexPath destinationIndexPath)Called frequently while the drop session being tracked inside the table view's coordinate space.voidtableViewPerformDropWithCoordinator(@NotNull UITableView tableView, @NotNull UITableViewDropCoordinator coordinator)Called when the user initiates the drop.
-
-
-
Method Detail
-
tableViewCanHandleDropSession
default boolean tableViewCanHandleDropSession(@NotNull @NotNull UITableView tableView, @NotNull @NotNull UIDropSession session)If NO is returned no further delegate methods will be called for this drop session. If not implemented, a default value of YES is assumed.
-
tableViewDropPreviewParametersForRowAtIndexPath
@Nullable default @Nullable UIDragPreviewParameters tableViewDropPreviewParametersForRowAtIndexPath(@NotNull @NotNull UITableView tableView, @NotNull @NotNull NSIndexPath indexPath)
Allows customization of the preview used when dropping to a newly inserted row. If not implemented or if nil is returned, the entire cell will be used for the preview.
-
tableViewDropSessionDidEnd
default void tableViewDropSessionDidEnd(@NotNull @NotNull UITableView tableView, @NotNull @NotNull UIDropSession session)Called when the drop session completed, regardless of outcome. Useful for performing any cleanup.
-
tableViewDropSessionDidEnter
default void tableViewDropSessionDidEnter(@NotNull @NotNull UITableView tableView, @NotNull @NotNull UIDropSession session)Called when the drop session begins tracking in the table view's coordinate space.
-
tableViewDropSessionDidExit
default void tableViewDropSessionDidExit(@NotNull @NotNull UITableView tableView, @NotNull @NotNull UIDropSession session)Called when the drop session is no longer being tracked inside the table view's coordinate space.
-
tableViewDropSessionDidUpdateWithDestinationIndexPath
@NotNull default @NotNull UITableViewDropProposal tableViewDropSessionDidUpdateWithDestinationIndexPath(@NotNull @NotNull UITableView tableView, @NotNull @NotNull UIDropSession session, @Nullable @Nullable NSIndexPath destinationIndexPath)
Called frequently while the drop session being tracked inside the table view's coordinate space. When the drop is at the end of a section, the destination index path passed will be for a row that does not yet exist (equal to the number of rows in that section), where an inserted row would append to the end of the section. The destination index path may be nil in some circumstances (e.g. when dragging over empty space where there are no cells). Note that in some cases your proposal may not be allowed and the system will enforce a different proposal. You may perform your own hit testing via -[session locationInView:]
-
tableViewPerformDropWithCoordinator
void tableViewPerformDropWithCoordinator(@NotNull @NotNull UITableView tableView, @NotNull @NotNull UITableViewDropCoordinator coordinator)Called when the user initiates the drop. Use the drop coordinator to access the items in the drop and the final destination index path and proposal for the drop, as well as specify how you wish to animate each item to its final position. If your implementation of this method does nothing, default drop animations will be supplied and the table view will revert back to its initial state before the drop session entered.
-
-