---
title: role
framework: uikit
role: symbol
role_heading: Instance Property
path: uikit/uibutton/role-swift.property
---

# role

The role of the button.

## Declaration

```swift
var role: UIButton.Role { get set }
```

## Discussion

Discussion Set the UIButton.Role to define a button as the primary action or the cancel action in a view. Catalyst apps use this role to set the appearance and default key-binding of the buttons.

## See Also

### Specifying the role

- [UIButton.Role](uikit/uibutton/role-swift.enum.md)
