<!--
{
  "availability" : [
    "macOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "AppKit",
  "identifier" : "/documentation/AppKit/NSOutlineView/setDropItem(_:dropChildIndex:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "AppKit"
    ],
    "preciseIdentifier" : "c:objc(cs)NSOutlineView(im)setDropItem:dropChildIndex:"
  },
  "title" : "setDropItem(_:dropChildIndex:)"
}
-->

# setDropItem(_:dropChildIndex:)

Used to “retarget” a proposed drop.

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

## Parameters

`item`

The target item.

`index`

The drop index.

## Discussion

For example, to specify a drop on `someOutlineItem`, you specify `item` as `someOutlineItem` and `index` as [`NSOutlineViewDropOnItemIndex`](/documentation/AppKit/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`](/documentation/AppKit/NSOutlineViewDropOnItemIndex).

---

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)