<!--
{
  "availability" : [
    "iOS: 13.0.0 -",
    "iPadOS: 13.0.0 -",
    "macCatalyst: -",
    "tvOS: 14.0.0 -",
    "visionOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "UIKit",
  "identifier" : "/documentation/UIKit/UIMenuBuilder/command(for:propertyList:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "UIKit"
    ],
    "preciseIdentifier" : "s:So13UIMenuBuilderP5UIKitE7command3for12propertyListSo9UICommandCSg10ObjectiveC8SelectorV_ypSgtF"
  },
  "title" : "command(for:propertyList:)"
}
-->

# command(for:propertyList:)

Gets the command for the specified selector and property list.

```
@MainActor @preconcurrency func command(for action: Selector, propertyList: Any? = nil) -> UICommand?
```

## Parameters

`action`

The selector of the command to retrieve.

`propertyList`

The property list object that identifies the command when more than one command uses the same action.

## Return Value

A command object; otherwise, `nil` if there is no such command.

---

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)