---
title: "command(for:propertyList:)"
framework: uikit
role: symbol
role_heading: Instance Method
path: "uikit/uimenubuilder/command(for:propertylist:)"
---

# command(for:propertyList:)

Gets the command for the specified selector and property list.

## Declaration

```swift
@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

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

## See Also

### Getting menu systems and elements

- [system](uikit/uimenubuilder/system.md)
- [menu(for:)](uikit/uimenubuilder/menu(for:).md)
- [action(for:)](uikit/uimenubuilder/action(for:).md)
