public interface UIDropInteractionDelegate
| Modifier and Type | Method and Description |
|---|---|
default boolean |
dropInteractionCanHandleSession(UIDropInteraction interaction,
UIDropSession session)
Return whether the delegate is interested in the given session.
|
default void |
dropInteractionConcludeDrop(UIDropInteraction interaction,
UIDropSession session)
Called when the user has dropped onto this interaction's view,
after `-dropInteraction:performDrop:` has been called,
and all resulting drop animations have completed.
|
default void |
dropInteractionItemWillAnimateDropWithAnimator(UIDropInteraction interaction,
UIDragItem item,
UIDragAnimating animator)
Called when the drop animation is about to start, once for each item,
whether it is visible or not.
|
default void |
dropInteractionPerformDrop(UIDropInteraction interaction,
UIDropSession session)
Called when the user drops onto this interaction's view.
|
default UITargetedDragPreview |
dropInteractionPreviewForDroppingItemWithDefault(UIDropInteraction interaction,
UIDragItem item,
UITargetedDragPreview defaultPreview)
Called when the drop happens, after `-dropInteraction:performDrop:`, once for each visible item.
|
default void |
dropInteractionSessionDidEnd(UIDropInteraction interaction,
UIDropSession session)
When the drag session ends, for any reason, this method will be called
for *every* interaction that ever received `-dropInteraction:sessionDidEnter:`,
`-dropInteraction:sessionDidUpdate:`, or `-dropInteraction:sessionDidExit:`.
|
default void |
dropInteractionSessionDidEnter(UIDropInteraction interaction,
UIDropSession session)
Called when a drag enters the view.
|
default void |
dropInteractionSessionDidExit(UIDropInteraction interaction,
UIDropSession session)
Called when the drag has exited the interaction's view.
|
default UIDropProposal |
dropInteractionSessionDidUpdate(UIDropInteraction interaction,
UIDropSession session)
Called when the drag enters the interaction's view, or when when the drag
moves while inside the view, or if items are added to the drag while inside the view.
|
default boolean dropInteractionCanHandleSession(UIDropInteraction interaction, UIDropSession session)
Note that returning true does not mean that the delegate definitely *will* accept this drop, just that it *might* want to accept the drop. To accept it, you must also implement `-dropInteraction:sessionDidUpdate:` and return a UIDropProposal with an appropriate operation.
This method is commonly used to check whether the session contains any items that this delegate can consume. Use `UIDropSession`'s convenience methods `-hasItemsConformingToTypeIdentifiers:`, `-canLoadObjectsOfClass:`, etc.
default void dropInteractionConcludeDrop(UIDropInteraction interaction, UIDropSession session)
The delegate should cause the interaction's view to draw in its final post-drop state.
default void dropInteractionItemWillAnimateDropWithAnimator(UIDropInteraction interaction, UIDragItem item, UIDragAnimating animator)
default void dropInteractionPerformDrop(UIDropInteraction interaction, UIDropSession session)
default UITargetedDragPreview dropInteractionPreviewForDroppingItemWithDefault(UIDropInteraction interaction, UIDragItem item, UITargetedDragPreview defaultPreview)
default void dropInteractionSessionDidEnd(UIDropInteraction interaction, UIDropSession session)
If you were keeping track of the session for any reason, you may now forget it.
default void dropInteractionSessionDidEnter(UIDropInteraction interaction, UIDropSession session)
default void dropInteractionSessionDidExit(UIDropInteraction interaction, UIDropSession session)
default UIDropProposal dropInteractionSessionDidUpdate(UIDropInteraction interaction, UIDropSession session)
You *must* implement this method to accept a drop. Return a `UIDropProposal` that contains the operation that the delegate would like to perform. (Note that you may use `UIDropOperationMove` only if session.allowsMoveOperation is true.)
You may also set other properties on the `UIDropProposal` to change the appearance of the drag over this view.
Use the session's `-locationInView:` to get a point to use for hit testing.