---
title: "SecTransformSetTransformAction(_:_:_:)"
framework: security
role: symbol
role_heading: Function
path: "security/sectransformsettransformaction(_:_:_:)"
---

# SecTransformSetTransformAction(_:_:_:)

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

## Declaration

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

## Parameters

- `ref`: A custom transform.
- `action`: The behavior to change. Valid values are doc://com.apple.security/documentation/Security/kSecTransformActionCanExecute, doc://com.apple.security/documentation/Security/kSecTransformActionStartingExecution, doc://com.apple.security/documentation/Security/kSecTransformActionFinalize, or doc://com.apple.security/documentation/Security/kSecTransformActionExternalizeExtraData.
- `newAction`: A doc://com.apple.security/documentation/Security/SecTransformActionBlock block that implements the behavior.

## Return Value

Return Value An error on failure, or NULL on success. In Objective-C, call the CFRelease function to free the error’s memory when you are done with it.
