<!--
{
  "availability" : [
    "macOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "AppKit",
  "identifier" : "/documentation/AppKit/NSApplicationDelegate/applicationDockMenu(_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "AppKit"
    ],
    "preciseIdentifier" : "c:objc(pl)NSApplicationDelegate(im)applicationDockMenu:"
  },
  "title" : "applicationDockMenu(_:)"
}
-->

# applicationDockMenu(_:)

Returns the app’s dock menu.

```
@MainActor optional func applicationDockMenu(_ sender: NSApplication) -> NSMenu?
```

## Parameters

`sender`

The application object associated with the delegate.

## Return Value

The menu to display in the dock.

## Discussion

You can also connect a menu in Interface Builder to the `dockMenu` outlet. A third way for your application to specify a dock menu is to provide an `NSMenu` in a nib.

If this method returns a menu, this menu takes precedence over the `dockMenu` in the nib.

The target and action for each menu item are passed to the dock. On selection of the menu item the dock messages your application, which should invoke `[NSApp sendAction:selector to:target from:nil]`.

To specify an `NSMenu` in a nib, you add the nib name to the `info.plist`, using the key `AppleDockMenu`. The nib name is specified without an extension. You then create a connection from the file’s owner object (which by default is `NSApplication`) to the menu. Connect the menu to the `dockMenu` outlet of `NSApplication`. The menu is in its own nib file so it can be loaded lazily when the `dockMenu` is requested, rather than at launch time.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)