Interface UITableViewDragDelegate


  • public interface UITableViewDragDelegate
    _______________________________________________________________________________________________________________ Drag & Drop API-Since: 11.0
    • Method Detail

      • tableViewDragPreviewParametersForRowAtIndexPath

        @Nullable
        default @Nullable UIDragPreviewParameters tableViewDragPreviewParametersForRowAtIndexPath​(@NotNull
                                                                                                  @NotNull UITableView tableView,
                                                                                                  @NotNull
                                                                                                  @NotNull NSIndexPath indexPath)
        Allows customization of the preview used for the row when it is lifted or if the drag cancels. If not implemented or if nil is returned, the entire cell will be used for the preview.
      • tableViewDragSessionAllowsMoveOperation

        default boolean tableViewDragSessionAllowsMoveOperation​(@NotNull
                                                                @NotNull UITableView tableView,
                                                                @NotNull
                                                                @NotNull UIDragSession session)
        Controls whether move operations are allowed for the drag session. If not implemented, defaults to YES.
      • tableViewDragSessionDidEnd

        default void tableViewDragSessionDidEnd​(@NotNull
                                                @NotNull UITableView tableView,
                                                @NotNull
                                                @NotNull UIDragSession session)
        Called to signal the end of the drag session.
      • tableViewDragSessionIsRestrictedToDraggingApplication

        default boolean tableViewDragSessionIsRestrictedToDraggingApplication​(@NotNull
                                                                              @NotNull UITableView tableView,
                                                                              @NotNull
                                                                              @NotNull UIDragSession session)
        Controls whether the drag session is restricted to the source application. If not implemented, defaults to NO.
      • tableViewDragSessionWillBegin

        default void tableViewDragSessionWillBegin​(@NotNull
                                                   @NotNull UITableView tableView,
                                                   @NotNull
                                                   @NotNull UIDragSession session)
        Called after the lift animation has completed to signal the start of a drag session. This call will always be balanced with a corresponding call to -tableView:dragSessionDidEnd:
      • tableViewItemsForAddingToDragSessionAtIndexPathPoint

        @NotNull
        default @NotNull NSArray<? extends UIDragItem> tableViewItemsForAddingToDragSessionAtIndexPathPoint​(@NotNull
                                                                                                            @NotNull UITableView tableView,
                                                                                                            @NotNull
                                                                                                            @NotNull UIDragSession session,
                                                                                                            @NotNull
                                                                                                            @NotNull NSIndexPath indexPath,
                                                                                                            CGPoint point)
        Called to request items to add to an existing drag session in response to the add item gesture. You can use the provided point (in the table view's coordinate space) to do additional hit testing if desired. If not implemented, or if an empty array is returned, no items will be added to the drag and the gesture will be handled normally.
      • tableViewItemsForBeginningDragSessionAtIndexPath

        @NotNull
        @NotNull NSArray<? extends UIDragItem> tableViewItemsForBeginningDragSessionAtIndexPath​(@NotNull
                                                                                                @NotNull UITableView tableView,
                                                                                                @NotNull
                                                                                                @NotNull UIDragSession session,
                                                                                                @NotNull
                                                                                                @NotNull NSIndexPath indexPath)
        Provide items to begin a drag associated with a given index path. You can use -[session locationInView:] to do additional hit testing if desired. If an empty array is returned a drag session will not begin.