Package apple.uikit.protocol
Interface UITextDragDelegate
-
public interface UITextDragDelegate
-
-
Method Summary
All Methods Instance Methods Default Methods Modifier and Type Method Description default UITargetedDragPreviewtextDraggableViewDragPreviewForLiftingItemSession(UIView textDraggableView, UIDragItem item, UIDragSession session)Provide a preview for lifting the item out of the text control.default voidtextDraggableViewDragSessionDidEndWithOperation(UIView textDraggableView, UIDragSession session, long operation)Called when a drag out of this text control has ended.default voidtextDraggableViewDragSessionWillBegin(UIView textDraggableView, UIDragSession session)Called when the user actually begins dragging.default NSArray<? extends UIDragItem>textDraggableViewItemsForDrag(UIView textDraggableView, UITextDragRequest dragRequest)Implement this to provide custom drag items when dragging out of a text control.default voidtextDraggableViewWillAnimateLiftWithAnimatorSession(UIView textDraggableView, UIDragAnimating animator, UIDragSession session)Called when the lift animation is about to start.
-
-
-
Method Detail
-
textDraggableViewDragPreviewForLiftingItemSession
default UITargetedDragPreview textDraggableViewDragPreviewForLiftingItemSession(UIView textDraggableView, UIDragItem item, 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(UIView textDraggableView, 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(UIView textDraggableView, 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
default NSArray<? extends UIDragItem> textDraggableViewItemsForDrag(UIView textDraggableView, 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(UIView textDraggableView, UIDragAnimating animator, 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.
-
-