Package apple.uikit.protocol
Interface UITextDragDelegate
-
public interface UITextDragDelegateAPI-Since: 11.0
-
-
Method Summary
All Methods Instance Methods Default Methods Modifier and Type Method Description default @Nullable UITargetedDragPreviewtextDraggableViewDragPreviewForLiftingItemSession(@NotNull UIView textDraggableView, @NotNull UIDragItem item, @NotNull UIDragSession session)Provide a preview for lifting the item out of the text control.default voidtextDraggableViewDragSessionDidEndWithOperation(@NotNull UIView textDraggableView, @NotNull UIDragSession session, long operation)Called when a drag out of this text control has ended.default voidtextDraggableViewDragSessionWillBegin(@NotNull UIView textDraggableView, @NotNull UIDragSession session)Called when the user actually begins dragging.default @NotNull NSArray<? extends UIDragItem>textDraggableViewItemsForDrag(@NotNull UIView textDraggableView, @NotNull UITextDragRequest dragRequest)Implement this to provide custom drag items when dragging out of a text control.default voidtextDraggableViewWillAnimateLiftWithAnimatorSession(@NotNull UIView textDraggableView, @NotNull UIDragAnimating animator, @NotNull UIDragSession session)Called when the lift animation is about to start.
-
-
-
Method Detail
-
textDraggableViewDragPreviewForLiftingItemSession
@Nullable default @Nullable UITargetedDragPreview textDraggableViewDragPreviewForLiftingItemSession(@NotNull @NotNull UIView textDraggableView, @NotNull @NotNull UIDragItem item, @NotNull @NotNull UIDragSession session)
Provide a preview for lifting the item out of the text control. If you return nil, the drag interaction will provide a default preview. Note: This will not be called for items obtained from a UITextDragRequest’s suggestedItems (via textDraggableView:itemsForDrag:). The text control will use its own previews for those items.
-
textDraggableViewDragSessionDidEndWithOperation
default void textDraggableViewDragSessionDidEndWithOperation(@NotNull @NotNull UIView textDraggableView, @NotNull @NotNull UIDragSession session, long operation)Called when a drag out of this text control has ended. The operation tells you what happened on the drop side.
-
textDraggableViewDragSessionWillBegin
default void textDraggableViewDragSessionWillBegin(@NotNull @NotNull UIView textDraggableView, @NotNull @NotNull UIDragSession session)Called when the user actually begins dragging. At that point, the text has lifted out of the text control. `textDraggableView:dragSessionDidEnd:withOperation:` will be called when the drag ends.
-
textDraggableViewItemsForDrag
@NotNull default @NotNull NSArray<? extends UIDragItem> textDraggableViewItemsForDrag(@NotNull @NotNull UIView textDraggableView, @NotNull @NotNull UITextDragRequest dragRequest)
Implement this to provide custom drag items when dragging out of a text control. If you return an empty array here, no drag will occur. The drag request provides the text range from which the user is dragging, and a set of default drag items which would be used if this delegate method were not implemented. You can modify and/or augment these at will. Note: this method might be called more than once. For instance, if the control is asked to provide more items to add to an existing session. You can detect this by checking the `existingItems` in the drag request.
-
textDraggableViewWillAnimateLiftWithAnimatorSession
default void textDraggableViewWillAnimateLiftWithAnimatorSession(@NotNull @NotNull UIView textDraggableView, @NotNull @NotNull UIDragAnimating animator, @NotNull @NotNull UIDragSession session)Called when the lift animation is about to start. Use the animator to animate your own changes alongside the system animation, or to be called when the lift animation completes.
-
-