<!--
{
  "availability" : [
    "macOS: 10.1.0 - 10.10.0"
  ],
  "documentType" : "symbol",
  "framework" : "ObjectiveC",
  "identifier" : "/documentation/ObjectiveC/NSObject-swift.class/accessibilitySetValue(_:forAttribute:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Objective-C Runtime",
      "ObjectiveC"
    ],
    "preciseIdentifier" : "c:objc(cs)NSObject(im)accessibilitySetValue:forAttribute:"
  },
  "title" : "accessibilitySetValue(_:forAttribute:)"
}
-->

# accessibilitySetValue(_:forAttribute:)

Sets the value of the specified attribute in the receiver to the specified value.

```
func accessibilitySetValue(_ value: Any?, forAttribute attribute: NSAccessibility.Attribute)
```

## Parameters

`value`

The attribute value to be set.

`attribute`

The name of the attribute. See <doc://com.apple.documentation/documentation/AppKit/nsaccessibility> constants for lists of attribute names.

## Discussion

User interface classes must implement this method if any of its attributes are settable. Subclasses should invoke the superclass’s implementation, if it exists, if `attribute` is not implemented in the subclass.

---

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)