<!--
{
  "availability" : [
    "macOS: 10.7.0 - 13.0.0"
  ],
  "documentType" : "symbol",
  "framework" : "Security",
  "identifier" : "/documentation/Security/SecTransformCustomSetAttribute(_:_:_:_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Function",
  "symbol" : {
    "kind" : "Function",
    "modules" : [
      "Security"
    ],
    "preciseIdentifier" : "c:@F@SecTransformCustomSetAttribute"
  },
  "title" : "SecTransformCustomSetAttribute(_:_:_:_:)"
}
-->

# SecTransformCustomSetAttribute(_:_:_:_:)

Sets an attribute value on a custom transform.

```
func SecTransformCustomSetAttribute(_ ref: SecTransformImplementationRef, _ attribute: SecTransformStringOrAttribute, _ type: SecTransformMetaAttributeType, _ value: CFTypeRef?) -> CFTypeRef?
```

## Parameters

`ref`

A [`SecTransformImplementationRef`](/documentation/Security/SecTransformImplementationRef) that is bound to an instance of a custom transform.

`attribute`

The name or the attribute handle of the attribute whose value is to be set. When using a name, see [Transform Attributes](/documentation/Security/transform-attributes) for a list of valid key names.

`type`

The type of data to be retrieved for the attribute. See the discussion on [`SecTransformMetaAttributeType`](/documentation/Security/SecTransformMetaAttributeType) for details.

`value`

The new value for the attribute

## Return Value

An error on failure, or `NULL` on success. In Objective-C, call the <doc://com.apple.documentation/documentation/CoreFoundation/CFRelease> function to free the error’s memory when you are done with it.

## Discussion

Unlike the [`SecTransformSetAttribute(_:_:_:_:)`](/documentation/Security/SecTransformSetAttribute(_:_:_:_:)) function this function can set attribute values while a transform is executing. These values are limited to the custom transform instance that is bound to the `ref` parameter.

---

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)