---
title: cancellationHandler
framework: foundation
role: symbol
role_heading: Instance Property
path: foundation/progress/cancellationhandler
---

# cancellationHandler

The block to invoke when canceling progress.

## Declaration

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

## Discussion

Discussion If the receiver is a suboperation of another progress object, the system invokes the cancellationHandler block when canceling the containing progress object. Special Considerations You’re responsible for canceling any work for the progress object. You can invoke the cancellation handler on any queue. If you must do work on a specific queue, dispatch to that queue from within the cancellation handler block.

## See Also

### Reporting Progress

- [totalUnitCount](foundation/progress/totalunitcount.md)
- [completedUnitCount](foundation/progress/completedunitcount.md)
- [localizedDescription](foundation/progress/localizeddescription.md)
- [localizedAdditionalDescription](foundation/progress/localizedadditionaldescription.md)
- [isCancellable](foundation/progress/iscancellable.md)
- [isCancelled](foundation/progress/iscancelled.md)
- [isPausable](foundation/progress/ispausable.md)
- [isPaused](foundation/progress/ispaused.md)
- [pausingHandler](foundation/progress/pausinghandler.md)
