Interface UITableViewDropDelegate


  • public interface UITableViewDropDelegate
    • Method Detail

      • tableViewCanHandleDropSession

        default boolean tableViewCanHandleDropSession​(UITableView tableView,
                                                      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

        default UIDragPreviewParameters tableViewDropPreviewParametersForRowAtIndexPath​(UITableView tableView,
                                                                                        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​(UITableView tableView,
                                                UIDropSession session)
        Called when the drop session completed, regardless of outcome. Useful for performing any cleanup.
      • tableViewDropSessionDidEnter

        default void tableViewDropSessionDidEnter​(UITableView tableView,
                                                  UIDropSession session)
        Called when the drop session begins tracking in the table view's coordinate space.
      • tableViewDropSessionDidExit

        default void tableViewDropSessionDidExit​(UITableView tableView,
                                                 UIDropSession session)
        Called when the drop session is no longer being tracked inside the table view's coordinate space.
      • tableViewDropSessionDidUpdateWithDestinationIndexPath

        default UITableViewDropProposal tableViewDropSessionDidUpdateWithDestinationIndexPath​(UITableView tableView,
                                                                                              UIDropSession session,
                                                                                              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​(UITableView tableView,
                                                 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.