<!--
{
  "availability" : [
    "iOS: 14.0.0 -",
    "iPadOS: 14.0.0 -",
    "macCatalyst: 14.0.0 -",
    "tvOS: 14.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "UIKit",
  "identifier" : "/documentation/UIKit/UIButton/Role-swift.enum",
  "metadataVersion" : "0.1.0",
  "role" : "Enumeration",
  "symbol" : {
    "kind" : "Enumeration",
    "modules" : [
      "UIKit"
    ],
    "preciseIdentifier" : "c:@E@UIButtonRole"
  },
  "title" : "UIButton.Role"
}
-->

# UIButton.Role

Constants that describe the role of the button.

```
enum Role
```

## Topics

### Button Roles

[`case normal`](/documentation/UIKit/UIButton/Role-swift.enum/normal)

A button role for a default button style.

[`case primary`](/documentation/UIKit/UIButton/Role-swift.enum/primary)

A button role that responds to a primary key press.

[`case cancel`](/documentation/UIKit/UIButton/Role-swift.enum/cancel)

A button role that responds to a cancel action.

[`case destructive`](/documentation/UIKit/UIButton/Role-swift.enum/destructive)

A button role with a red background color.

### Initializers

[`init?(rawValue: Int)`](/documentation/UIKit/UIButton/Role-swift.enum/init(rawValue:))

## Relationships

### Conforms To

[`Equatable`](/documentation/Swift/Equatable)

[`SendableMetatype`](/documentation/Swift/SendableMetatype)

[`RawRepresentable`](/documentation/Swift/RawRepresentable)

[`Sendable`](/documentation/Swift/Sendable)

[`Hashable`](/documentation/Swift/Hashable)

[`BitwiseCopyable`](/documentation/Swift/BitwiseCopyable)

---

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)