how can I show different view than collection view cell when long pressing for the context menu?

Asked on 08/05/2024

1 search

To show a different view than a collection view cell when long pressing for the context menu, you can use the new API refinements in AppKit. Specifically, you can influence the positioning of context menus by setting a value for the menu property of your view. This will automatically position the menu over the view's bounds. If your view draws a custom selection, you can implement the NSViewContentSelectionInfo protocol to provide geometry information about the selection, ensuring the menu is positioned appropriately near the selection.

For more details, you can refer to the session What’s new in AppKit at the timestamp 08:49.

Relevant Sessions

  1. What’s new in AppKit
  2. Enhance your UI animations and transitions