SecTransformActionBlock
A block that overrides the default behavior of a custom transform.
Declaration
typealias SecTransformActionBlock = () -> Unmanaged<CFTypeRef>?Return Value
A dictionary of the custom items to be exported if this block is used to override the kSecTransformActionExternalizeExtraData action or NULL for any other action. Alternatively, the block returns a CFError object if an error occurs.
Discussion
A block of this type is used to override the default behavior of a custom transform. This block is associated with the SecTransformOverrideTransformAction block.
The behaviors that can be overridden are:
kSecTransformActionCanExecute - Determine if the transform has all of the data needed to run.
kSecTransformActionStartingExecution - Called just before running ProcessData.
kSecTransformActionFinalize - Called just before deleting the custom transform.
kSecTransformActionExternalizeExtraData - Called to allow for writing out custom data to be exported.
For example:
SecTransformImplementationRef ref;
CFErrorRef error = NULL;
error = SecTransformSetTransformAction(ref, kSecTransformActionStartingExecution, ^{
// Initialize any data needed before running
CFErrorRef result = DoMyInitialization();
return result;});
SecTransformTransformActionBlock actionBlock =
^{
// Clean up any existing data before running
CFErrorRef result = DoMyFinalization();
return result;};
error = SecTransformSetTransformAction(ref, kSecTransformActionFinalize,actionBlock);