---
title: "popUpContextMenu(_:with:for:)"
framework: appkit
role: symbol
role_heading: Type Method
path: "appkit/nsmenu/popupcontextmenu(_:with:for:)"
---

# popUpContextMenu(_:with:for:)

Displays a contextual menu over a view for an event.

## Declaration

```swift
class func popUpContextMenu(_ menu: NSMenu, with event: NSEvent, for view: NSView)
```

## Parameters

- `menu`: The menu object to use for the contextual menu.
- `event`: An doc://com.apple.appkit/documentation/AppKit/NSEvent object representing the event.
- `view`: The view object over which to display the contextual menu.

## Mentioned in

Supporting Continuity Camera in Your Mac App Supporting Writing Tools via the pasteboard

## See Also

### Displaying Context-Sensitive Help

- [popUpContextMenu(_:with:for:with:)](appkit/nsmenu/popupcontextmenu(_:with:for:with:).md)
- [helpRequested(with:)](appkit/nsmenu/helprequested(with:).md)
- [popUp(positioning:at:in:)](appkit/nsmenu/popup(positioning:at:in:).md)
