---
title: "menu(for:)"
framework: Finder Sync
role: symbol
role_heading: Instance Method
platforms: [macOS 10.10+]
path: "findersync/fifindersyncprotocol/menu(for:)"
---

# menu(for:)

Requests a custom menu from the extension.

## Declaration

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

## Parameters

- `menu`: The type of menu being displayed. For a list of possible values, see doc://com.apple.Finder-Sync/documentation/FinderSync/FIMenuKind.

## Return Value

Return Value A custom menu.

## Discussion

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. 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

### Related Documentation

- [targetedURL()](findersync/fifindersynccontroller/targetedurl().md)
- [selectedItemURLs()](findersync/fifindersynccontroller/selecteditemurls().md)

### Managing Badges, Shortcut Menus, and Toolbar Buttons

- [beginObservingDirectory(at:)](findersync/fifindersyncprotocol/beginobservingdirectory(at:).md)
- [endObservingDirectory(at:)](findersync/fifindersyncprotocol/endobservingdirectory(at:).md)
- [requestBadgeIdentifier(for:)](findersync/fifindersyncprotocol/requestbadgeidentifier(for:).md)
- [toolbarItemImage](findersync/fifindersyncprotocol/toolbaritemimage.md)
- [toolbarItemName](findersync/fifindersyncprotocol/toolbaritemname.md)
- [toolbarItemToolTip](findersync/fifindersyncprotocol/toolbaritemtooltip.md)
