Interface UITextDropDelegate


  • public interface UITextDropDelegate
    API-Since: 11.0
    • Method Detail

      • textDroppableViewDropSessionDidEnd

        default void textDroppableViewDropSessionDidEnd​(@NotNull
                                                        @NotNull UIView textDroppableView,
                                                        @NotNull
                                                        @NotNull UIDropSession session)
        Called when the drag has ended.
      • textDroppableViewDropSessionDidEnter

        default void textDroppableViewDropSessionDidEnter​(@NotNull
                                                          @NotNull UIView textDroppableView,
                                                          @NotNull
                                                          @NotNull UIDropSession session)
        Called when a drag has entered the text view.
      • textDroppableViewDropSessionDidExit

        default void textDroppableViewDropSessionDidExit​(@NotNull
                                                         @NotNull UIView textDroppableView,
                                                         @NotNull
                                                         @NotNull UIDropSession session)
        Called when the drag has left the view.
      • textDroppableViewDropSessionDidUpdate

        default void textDroppableViewDropSessionDidUpdate​(@NotNull
                                                           @NotNull UIView textDroppableView,
                                                           @NotNull
                                                           @NotNull UIDropSession session)
        Called when the drag has updated. This is often, but not always, preceded by a call to -textDroppableView:proposalForDrop:. Note: this is called *very* frequently, so try to do minimal work.
      • textDroppableViewPreviewForDroppingAllItemsWithDefault

        @Nullable
        default @Nullable UITargetedDragPreview textDroppableViewPreviewForDroppingAllItemsWithDefault​(@NotNull
                                                                                                       @NotNull UIView textDroppableView,
                                                                                                       @NotNull
                                                                                                       @NotNull UITargetedDragPreview defaultPreview)
        Provide a custom preview for dropping text into the text control. Only one preview is used, regardless of the number of items being dropped. Because we're animating into one range of text, there is no need for individual previews. The defaultPreview is the preview that the control would normally use to animate the drop. It is based on the (ordered) combination of text representations for each item. (See UITextPasteDelegate to customize it.) It resembles the text that will be inserted into the view. If any of the items have not finished loading, this will be an animation into the location of the caret when the drop was being performed. Return nil to use the default preview of the underlying drop interaction.
      • textDroppableViewProposalForDrop

        @NotNull
        default @NotNull UITextDropProposal textDroppableViewProposalForDrop​(@NotNull
                                                                             @NotNull UIView textDroppableView,
                                                                             @NotNull
                                                                             @NotNull UITextDropRequest drop)
        Defines whether a text control can accept a drag. Return a UITextDropProposal here to change the drag behavior. This will get called: - when the drag enters the text control, - when the *text position* changes while the drag moves over the text control - when the drag session changes (e.g. items were added) Note: this is called frequently, so try to do minimal work.
      • textDroppableViewWillBecomeEditableForDrop

        default long textDroppableViewWillBecomeEditableForDrop​(@NotNull
                                                                @NotNull UIView textDroppableView,
                                                                @NotNull
                                                                @NotNull UITextDropRequest drop)
        By default, when the text control is not editable, drops will not occur. However, there might be scenarios where dropping into a non-editable text control is desirable. If not implemented, uses UITextDropEditabilityNo.
      • textDroppableViewWillPerformDrop

        default void textDroppableViewWillPerformDrop​(@NotNull
                                                      @NotNull UIView textDroppableView,
                                                      @NotNull
                                                      @NotNull UITextDropRequest drop)
        Indicates that the drop is about to be performed. To modify the result of the items to be dropped, provide a pasteHandler on the text control, which will handle the conversion and pasting of the text.