<!--
{
  "availability" : [
    "macOS: 10.0.0 - 10.15.0"
  ],
  "documentType" : "symbol",
  "framework" : "AppKit",
  "identifier" : "/documentation/AppKit/NSOutlineViewDataSource/outlineView(_:writeItems:to:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "AppKit"
    ],
    "preciseIdentifier" : "c:objc(pl)NSOutlineViewDataSource(im)outlineView:writeItems:toPasteboard:"
  },
  "title" : "outlineView(_:writeItems:to:)"
}
-->

# outlineView(_:writeItems:to:)

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

```
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

<doc://com.apple.documentation/documentation/Swift/true> if the drag operation is allowed, otherwise <doc://com.apple.documentation/documentation/Swift/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 <doc://com.apple.documentation/documentation/Swift/false>. To start a drag, return <doc://com.apple.documentation/documentation/Swift/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 <doc://com.apple.documentation/documentation/Swift/true>.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)