---
title: terminationHandler
framework: foundation
role: symbol
role_heading: Instance Property
path: foundation/process/terminationhandler
---

# terminationHandler

A completion block the system invokes when the task completes.

## Declaration

```swift
var terminationHandler: (@Sendable (Process) -> Void)? { get set }
```

## Discussion

Discussion The system passes the task object to the block to allow access to the task parameters, for example to determine if the task completed successfully. This block isn’t guaranteed to be fully executed prior to waitUntilExit() returning.
