<!--
{
  "availability" : [
    "macOS: 10.5.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "AppKit",
  "identifier" : "/documentation/AppKit/NSPathCellDelegate/pathCell(_:willPopUp:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "AppKit"
    ],
    "preciseIdentifier" : "c:objc(pl)NSPathCellDelegate(im)pathCell:willPopUpMenu:"
  },
  "title" : "pathCell(_:willPopUp:)"
}
-->

# pathCell(_:willPopUp:)

Implement this method to customize the menu of a pop-up–style path.

```
@MainActor optional func pathCell(_ pathCell: NSPathCell, willPopUp menu: NSMenu)
```

## Parameters

`pathCell`

The path cell that sent the message.

`menu`

The pop-up menu to be displayed.

## Discussion

This method is called before the pop-up menu is shown. At this time, you can further customize the menu as required, adding and removing items. This method is called only when the style is set to `NSPathStylePopUp`.

Implementation of this method is optional.

---

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)