Contents

outlineView(_:writeItems:to:)

Returns a Boolean value that indicates whether a drag operation is allowed.

Declaration

optional func outlineView(_ outlineView: NSOutlineView, writeItems items: [Any], to pasteboard: NSPasteboard) -> Bool

Parameters

  • outlineView:

    The outline view that invoked the method.

  • items:

    An array of the items participating in the drag.

  • pasteboard:

    The pasteboard to which to write the drag data.

Return Value

true if the drag operation is allowed, otherwise false.

Discussion

Invoked by outlineView after it has been determined that a drag should begin, but before the drag has been started.

To refuse the drag, return false. To start a drag, return true and place the drag data onto the pboard (data, owner, and so on). The drag image and other drag-related information will be set up and provided by the outline view once this call returns with true.

See Also

Instance Methods