LavaUI docs GitHub

struct DropTargetView

Swift

struct DropTargetView<Content> where Content : View

Registers perform as the drop handler for the content's root layout box.

Sources/LavaUI/DropTarget.swift:36

Constructors

init(perform: @escaping ([URL]) -> Void, content: Content)

Makes content a drop target with no drag-over callbacks.

Sources/LavaUI/DropTarget.swift:49

init(targeted: ((Bool) -> Void)?, springLoaded: (() -> Void)?, perform: @escaping ([URL]) -> Void, content: Content)

Makes content a drop target. Usually spelled .onDrop(targeted:springLoaded:perform:).

Sources/LavaUI/DropTarget.swift:54

Properties

var content: Content

The view that accepts drops.

Sources/LavaUI/DropTarget.swift:46

var dumpDetail: String { get }

Not documented.

Sources/LavaUI/DropTarget.swift:66

var perform: ([URL]) -> Void

Called with the dropped files when a drag is released over the view.

Sources/LavaUI/DropTarget.swift:38

var springLoaded: (() -> Void)?

Called once a drag has rested over the view for DropRouter.springDelay. Needs a compositor.

Sources/LavaUI/DropTarget.swift:44

var targeted: ((Bool) -> Void)?

Called with true when a drag becomes aimed at the view and false when it leaves, drops or ends elsewhere. Needs a compositor.

Sources/LavaUI/DropTarget.swift:41

Methods

func mountPrimitive() -> any AnyViewNode

Not documented.

Sources/LavaUI/DropTarget.swift:76

func reconcilePrimitive(_ node: any AnyViewNode) -> any AnyViewNode

Not documented.

Sources/LavaUI/DropTarget.swift:80

func structureLines(indent: Int = 0) -> [String]

Not documented.

Sources/LavaUI/DropTarget.swift:68