---
title: "setDropItem(_:dropChildIndex:)"
framework: appkit
role: symbol
role_heading: Instance Method
path: "appkit/nsoutlineview/setdropitem(_:dropchildindex:)"
---

# setDropItem(_:dropChildIndex:)

Used to “retarget” a proposed drop.

## Declaration

```swift
func setDropItem(_ item: Any?, dropChildIndex index: Int)
```

## Parameters

- `item`: The target item.
- `index`: The drop index.

## Discussion

Discussion For example, to specify a drop on someOutlineItem, you specify item as someOutlineItem and index as NSOutlineViewDropOnItemIndex. To specify a drop between child 2 and 3 of someOutlineItem, you specify item as someOutlineItem and index as 3 (children are a zero-based index). To specify a drop on an un-expandable someOutlineItem, you specify item as someOutlineItem and index as NSOutlineViewDropOnItemIndex.

## See Also

### Supporting Drag and Drop

- [shouldCollapseAutoExpandedItems(forDeposited:)](appkit/nsoutlineview/shouldcollapseautoexpandeditems(fordeposited:).md)
