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

# SecTransformSetTransformAction(_:_:_:)

Changes the way that a transform deals with transform lifecycle behaviors.

```
func SecTransformSetTransformAction(_ ref: SecTransformImplementationRef, _ action: CFString, _ newAction: @escaping SecTransformActionBlock) -> CFError?
```

## Parameters

`ref`

A custom transform.

`action`

The behavior to change. Valid values are [`kSecTransformActionCanExecute`](/documentation/Security/kSecTransformActionCanExecute), [`kSecTransformActionStartingExecution`](/documentation/Security/kSecTransformActionStartingExecution), [`kSecTransformActionFinalize`](/documentation/Security/kSecTransformActionFinalize), or [`kSecTransformActionExternalizeExtraData`](/documentation/Security/kSecTransformActionExternalizeExtraData).

`newAction`

A [`SecTransformActionBlock`](/documentation/Security/SecTransformActionBlock) block that implements the behavior.

## 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.

---

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)