Interface UITextDropDelegate


  • public interface UITextDropDelegate
    • Method Detail

      • textDroppableViewDropSessionDidEnd

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

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

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

        default void textDroppableViewDropSessionDidUpdate​(UIView textDroppableView,
                                                           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

        default UITargetedDragPreview textDroppableViewPreviewForDroppingAllItemsWithDefault​(UIView textDroppableView,
                                                                                             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. Becase 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

        default UITextDropProposal textDroppableViewProposalForDrop​(UIView textDroppableView,
                                                                    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​(UIView textDroppableView,
                                                                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​(UIView textDroppableView,
                                                      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.