Skip to main content

draggable_text

Function draggable_text 

Source
pub fn draggable_text(view: &ViewHandle, text: &str) -> ViewHandle
Expand description

Apply .draggable(_:) with a String payload.

The overload everything else calls draggable: drag this view and a piece of text comes out, droppable anywhere that takes one. The containerItemID: binding next door is a different modifier for a different job — reordering within a container.

String because it is the Transferable conformer that needs no bridging: its witness is exported from CoreTransferable, and its value is two loadable words. A Data or a URL payload would each need their own.