<!--
{
  "availability" : [
    "macOS: 10.10.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "FinderSync",
  "identifier" : "/documentation/FinderSync/FIFinderSyncProtocol/menu(for:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Finder Sync"
    ],
    "preciseIdentifier" : "c:objc(pl)FIFinderSync(im)menuForMenuKind:"
  },
  "title" : "menu(for:)"
}
-->

# menu(for:)

Requests a custom menu from the extension.

```
optional func menu(for menu: FIMenuKind) -> NSMenu?
```

## Parameters

`menu`

The type of menu being displayed. For a list of possible values, see [`FIMenuKind`](/documentation/FinderSync/FIMenuKind).

## Return Value

A custom menu.

## Discussion

Override this method to provide custom menus in the Finder. You can
customize this menu based both on the menu’s kind and on the selected and
targeted items (if any). You can get the selected and targeted items from
the extension’s [`FIFinderSyncController`](/documentation/FinderSync/FIFinderSyncController).

If `kind` is `FIMenuKindToolbarItemMenu`, the system always calls this
method even if the target and selection are not related to the extension.

The extension’s principal object provides a method for each menu item’s
assigned action.

## See Also

[`-  targetedURL`](/documentation/FinderSync/FIFinderSyncController/targetedURL())

Returns the URL of the Finder’s current target.

[`-  selectedItemURLs`](/documentation/FinderSync/FIFinderSyncController/selectedItemURLs())

Returns an array of selected items.



---

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)