Contents

menu(for:)

Requests a custom menu from the extension.

Declaration

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

Parameters

  • menu:

    The type of menu being displayed. For a list of possible values, see 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.

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

Managing Badges, Shortcut Menus, and Toolbar Buttons