Interface UICollectionViewDragDelegate


  • public interface UICollectionViewDragDelegate
    • Method Detail

      • collectionViewDragPreviewParametersForItemAtIndexPath

        default UIDragPreviewParameters collectionViewDragPreviewParametersForItemAtIndexPath​(UICollectionView collectionView,
                                                                                              NSIndexPath indexPath)
        Allows customization of the preview used for the item being lifted from or cancelling back to the collection view. If not implemented or if nil is returned, the entire cell will be used for the preview.
      • collectionViewDragSessionAllowsMoveOperation

        default boolean collectionViewDragSessionAllowsMoveOperation​(UICollectionView collectionView,
                                                                     UIDragSession session)
        Controls whether move operations (see UICollectionViewDropProposal.operation) are allowed for the drag session. If not implemented this will default to YES.
      • collectionViewDragSessionDidEnd

        default void collectionViewDragSessionDidEnd​(UICollectionView collectionView,
                                                     UIDragSession session)
        Called to signal the end of the drag session.
      • collectionViewDragSessionIsRestrictedToDraggingApplication

        default boolean collectionViewDragSessionIsRestrictedToDraggingApplication​(UICollectionView collectionView,
                                                                                   UIDragSession session)
        Controls whether the drag session is restricted to the source application. If YES the current drag session will not be permitted to drop into another application. If not implemented this will default to NO.
      • collectionViewDragSessionWillBegin

        default void collectionViewDragSessionWillBegin​(UICollectionView collectionView,
                                                        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 -collectionView:dragSessionDidEnd:
      • collectionViewItemsForAddingToDragSessionAtIndexPathPoint

        default NSArray<? extends UIDragItem> collectionViewItemsForAddingToDragSessionAtIndexPathPoint​(UICollectionView collectionView,
                                                                                                        UIDragSession session,
                                                                                                        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 collection 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.
      • collectionViewItemsForBeginningDragSessionAtIndexPath

        NSArray<? extends UIDragItem> collectionViewItemsForBeginningDragSessionAtIndexPath​(UICollectionView collectionView,
                                                                                            UIDragSession session,
                                                                                            NSIndexPath indexPath)
        Provide items to begin a drag associated with a given indexPath. If an empty array is returned a drag session will not begin.