<!--
{
  "availability" : [
    "macOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "AppKit",
  "identifier" : "/documentation/AppKit/NSAccessibility-swift.struct/Role/description(with:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "AppKit"
    ],
    "preciseIdentifier" : "c:@F@NSAccessibilityRoleDescription"
  },
  "title" : "description(with:)"
}
-->

# description(with:)

Returns a standard description for a role and subrole.

```
func description(with subrole: NSAccessibility.Subrole?) -> String?
```

## Discussion

You should pass `nil` to this function if there is no subrole. This function returns a description of a standard role. For example, if you implement a button widget that does not inherit from [`NSButton`](/documentation/AppKit/NSButton), you should use this function to return a localized role description matching that returned by a standard button.

---

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)