---
title: "outlineView(_:writeItems:to:)"
framework: appkit
role: symbol
role_heading: Instance Method
path: "appkit/nsoutlineviewdatasource/outlineview(_:writeitems:to:)"
---

# outlineView(_:writeItems:to:)

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

## Declaration

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

Return Value true if the drag operation is allowed, otherwise false.

## Discussion

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

- [outlineView(_:acceptDrop:item:childIndex:)](appkit/nsoutlineviewdatasource/outlineview(_:acceptdrop:item:childindex:).md)
- [outlineView(_:child:ofItem:)](appkit/nsoutlineviewdatasource/outlineview(_:child:ofitem:).md)
- [outlineView(_:draggingSession:endedAt:operation:)](appkit/nsoutlineviewdatasource/outlineview(_:draggingsession:endedat:operation:).md)
- [outlineView(_:draggingSession:willBeginAt:forItems:)](appkit/nsoutlineviewdatasource/outlineview(_:draggingsession:willbeginat:foritems:).md)
- [outlineView(_:isItemExpandable:)](appkit/nsoutlineviewdatasource/outlineview(_:isitemexpandable:).md)
- [outlineView(_:itemForPersistentObject:)](appkit/nsoutlineviewdatasource/outlineview(_:itemforpersistentobject:).md)
- [outlineView(_:namesOfPromisedFilesDroppedAtDestination:forDraggedItems:)](appkit/nsoutlineviewdatasource/outlineview(_:namesofpromisedfilesdroppedatdestination:fordraggeditems:).md)
- [outlineView(_:numberOfChildrenOfItem:)](appkit/nsoutlineviewdatasource/outlineview(_:numberofchildrenofitem:).md)
- [outlineView(_:objectValueFor:byItem:)](appkit/nsoutlineviewdatasource/outlineview(_:objectvaluefor:byitem:).md)
- [outlineView(_:pasteboardWriterForItem:)](appkit/nsoutlineviewdatasource/outlineview(_:pasteboardwriterforitem:).md)
- [outlineView(_:persistentObjectForItem:)](appkit/nsoutlineviewdatasource/outlineview(_:persistentobjectforitem:).md)
- [outlineView(_:setObjectValue:for:byItem:)](appkit/nsoutlineviewdatasource/outlineview(_:setobjectvalue:for:byitem:).md)
- [outlineView(_:sortDescriptorsDidChange:)](appkit/nsoutlineviewdatasource/outlineview(_:sortdescriptorsdidchange:).md)
- [outlineView(_:updateDraggingItemsForDrag:)](appkit/nsoutlineviewdatasource/outlineview(_:updatedraggingitemsfordrag:).md)
- [outlineView(_:validateDrop:proposedItem:proposedChildIndex:)](appkit/nsoutlineviewdatasource/outlineview(_:validatedrop:proposeditem:proposedchildindex:).md)
