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

# shouldCollapseAutoExpandedItems(forDeposited:)

Returns a Boolean value that indicates whether auto-expanded items should return to their original collapsed state.

```
func shouldCollapseAutoExpandedItems(forDeposited deposited: Bool) -> Bool
```

## Parameters

`deposited`

If <doc://com.apple.documentation/documentation/Swift/true>, the drop terminated successfully; if <doc://com.apple.documentation/documentation/Swift/false> the drop failed.

## Return Value

<doc://com.apple.documentation/documentation/Swift/true> if auto-expanded items should return to their original collapsed state; otherwise <doc://com.apple.documentation/documentation/Swift/false>.

## Discussion

Override this method to provide custom behavior. If the target of a drop is not auto-expanded (by hovering long enough) the drop target still gets expanded after a successful drop unless this method returns <doc://com.apple.documentation/documentation/Swift/true>. The default implementation returns <doc://com.apple.documentation/documentation/Swift/false> after a successful drop.

This method is called in a variety of situations. For example, it is called shortly after the [`outlineView(_:acceptDrop:item:childIndex:)`](/documentation/AppKit/NSOutlineViewDataSource/outlineView(_:acceptDrop:item:childIndex:)) method is called and also if the drag exits the outline view (exiting the view is treated the same as a failed drop). The return value of the [`outlineView(_:acceptDrop:item:childIndex:)`](/documentation/AppKit/NSOutlineViewDataSource/outlineView(_:acceptDrop:item:childIndex:)) method determines the incoming value of the `deposited` parameter.

---

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)