public interface UICollectionViewDropCoordinator
| Modifier and Type | Method and Description |
|---|---|
NSIndexPath |
destinationIndexPath()
The last hit-tested index path known during the drop session.
|
UIDragAnimating |
dropItemIntoItemAtIndexPathRect(UIDragItem dragItem,
NSIndexPath indexPath,
CGRect rect)
Animate the dragItem to a rect inside an existing item.
|
UIDragAnimating |
dropItemToItemAtIndexPath(UIDragItem dragItem,
NSIndexPath indexPath)
Animate the dragItem to a newly inserted item at the specified index path.
|
UICollectionViewDropPlaceholderContext |
dropItemToPlaceholder(UIDragItem dragItem,
UICollectionViewDropPlaceholder placeholder)
Animate the dragItem to an automatically inserted placeholder item.
|
UIDragAnimating |
dropItemToTarget(UIDragItem dragItem,
UIDragPreviewTarget target)
Animate the dragItem to a location specified by the UIDragPreviewTarget.
|
NSArray<?> |
items()
Ordered list of items available for this drop.
|
UICollectionViewDropProposal |
proposal()
The current drop proposal at the time of the drop.
|
UIDropSession |
session() |
NSIndexPath destinationIndexPath()
UIDragAnimating dropItemIntoItemAtIndexPathRect(UIDragItem dragItem, NSIndexPath indexPath, CGRect rect)
UIDragAnimating dropItemToItemAtIndexPath(UIDragItem dragItem, NSIndexPath indexPath)
To tweak the appearance of the preview being dropping (e.g. supply a clipping path), see -collectionView:dropPreviewParametersForItemAtIndexPath:
UICollectionViewDropPlaceholderContext dropItemToPlaceholder(UIDragItem dragItem, UICollectionViewDropPlaceholder placeholder)
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.
UIDragAnimating dropItemToTarget(UIDragItem dragItem, UIDragPreviewTarget target)
NSArray<?> items()
UICollectionViewDropProposal proposal()
UIDropSession session()