Interface UICollectionViewDropCoordinator


  • public interface UICollectionViewDropCoordinator
    • Method Detail

      • destinationIndexPath

        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

        UIDragAnimating dropItemIntoItemAtIndexPathRect​(UIDragItem dragItem,
                                                        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

        UIDragAnimating dropItemToItemAtIndexPath​(UIDragItem dragItem,
                                                  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

        UICollectionViewDropPlaceholderContext dropItemToPlaceholder​(UIDragItem dragItem,
                                                                     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.
      • items

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