Interface UICollectionViewDropCoordinator


  • public interface UICollectionViewDropCoordinator
    API-Since: 11.0
    • Method Detail

      • destinationIndexPath

        @Nullable
        @Nullable NSIndexPath destinationIndexPath()
        The last hit-tested index path known during the drop session. If this is nil, the proposal's intent will be .unspecified
      • dropItemIntoItemAtIndexPathRect

        @NotNull
        @NotNull UIDragAnimating dropItemIntoItemAtIndexPathRect​(@NotNull
                                                                 @NotNull UIDragItem dragItem,
                                                                 @NotNull
                                                                 @NotNull NSIndexPath indexPath,
                                                                 CGRect rect)
        Animate the dragItem to a rect inside an existing item. The rect is in the coordinate space of the cell at this index path. The item will be animated with an aspect fit scale transform to fit inside the rect. Use a rect with zero size to shrink the item to a single point.
      • dropItemToItemAtIndexPath

        @NotNull
        @NotNull UIDragAnimating dropItemToItemAtIndexPath​(@NotNull
                                                           @NotNull UIDragItem dragItem,
                                                           @NotNull
                                                           @NotNull NSIndexPath indexPath)
        Animate the dragItem to a newly inserted item at the specified index path. You must call -performBatchUpdates:completion: to update your data source and insert a new item into the collection view prior to calling this method. To tweak the appearance of the preview being dropping (e.g. supply a clipping path), see -collectionView:dropPreviewParametersForItemAtIndexPath:
      • dropItemToPlaceholder

        @NotNull
        @NotNull UICollectionViewDropPlaceholderContext dropItemToPlaceholder​(@NotNull
                                                                              @NotNull UIDragItem dragItem,
                                                                              @NotNull
                                                                              @NotNull UICollectionViewDropPlaceholder placeholder)
        Animate the dragItem to an automatically inserted placeholder item. A placeholder cell will be created for the reuse identifier and inserted at the specified indexPath without requiring a dataSource update. The cellUpdateHandler will be called whenever the placeholder cell becomes visible; -collectionView:cellForItemAtIndexPath: will not be called for the placeholder. Once the dragItem data is available, you can exchange the temporary placeholder cell with the final cell using the placeholder context method -commitInsertionWithDataSourceUpdates: UICollectionViewDropPlaceholderContext also conforms to UIDragAnimating to allow adding alongside animations and completion handlers.
      • dropItemToTarget

        @NotNull
        @NotNull UIDragAnimating dropItemToTarget​(@NotNull
                                                  @NotNull UIDragItem dragItem,
                                                  @NotNull
                                                  @NotNull UIDragPreviewTarget target)
        Animate the dragItem to a location specified by the UIDragPreviewTarget.
      • items

        @NotNull
        @NotNull NSArray<?> items()
        Ordered list of items available for this drop.