---
title: "SecTaskCreateFromSelf(_:)"
framework: security
role: symbol
role_heading: Function
path: "security/sectaskcreatefromself(_:)"
---

# SecTaskCreateFromSelf(_:)

Creates a task object for the current task.

## Declaration

```swift
func SecTaskCreateFromSelf(_ allocator: CFAllocator?) -> SecTask?
```

## Parameters

- `allocator`: An allocator. Pass NULL to use the default.

## Return Value

Return Value A new task, or NULL on error. In Objective-C, call the CFRelease function to free this task’s memory when you are done with it.
