---
title: "init(popUpMenu:target:action:)"
framework: appkit
role: symbol
role_heading: Initializer
path: "appkit/nspopupbutton/init(popupmenu:target:action:)"
---

# init(popUpMenu:target:action:)

Creates a standard pop-up button with a menu, target, and action.

## Declaration

```swift
@backDeployed(before: macOS 15.0)
@MainActor @preconcurrency convenience init(popUpMenu: NSMenu, target: AnyObject?, action: Selector?)
```

## Parameters

- `popUpMenu`: A menu presented by the pop-up button, containing items that the user can choose between.
- `target`: The target object that receives action messages from the control.
- `action`: The action message sent by the control.

## Return Value

Return Value An initialized pop-up button object.

## Discussion

Discussion If menu is non-empty, the pop-up button uses the first item for its initial selection.
