<!--
{
  "availability" : [
    "macOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "AppKit",
  "identifier" : "/documentation/AppKit/NSOutlineView/itemWillCollapseNotification",
  "metadataVersion" : "0.1.0",
  "role" : "Type Property",
  "symbol" : {
    "kind" : "Type Property",
    "modules" : [
      "AppKit"
    ],
    "preciseIdentifier" : "c:@NSOutlineViewItemWillCollapseNotification"
  },
  "title" : "itemWillCollapseNotification"
}
-->

# itemWillCollapseNotification

Posted before an item is collapsed (after the user clicks the arrow but before the item is collapsed).

```
class let itemWillCollapseNotification: NSNotification.Name
```

## Discussion

The notification object is the `NSOutlineView` object that contains the item about to be collapsed. A collapsed item’s children will lose their status as being selected. The `userInfo` dictionary contains the following information:

|Key          |Value                                 |
|-------------|--------------------------------------|
|`@"NSObject"`|The item about to be collapsed (an id)|

To observe this notification using Swift concurrency, use [`NSOutlineView.ItemWillCollapseMessage`](/documentation/AppKit/NSOutlineView/ItemWillCollapseMessage).

---

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)