---
title: cancellationHandler
framework: XcodeKit
role: symbol
role_heading: Instance Property
platforms: [macOS 10.12+]
path: xcodekit/xcsourceeditorcommandinvocation/cancellationhandler
---

# cancellationHandler

A handler to be invoked by Xcode to indicate that the invocation has been canceled by the user.

## Declaration

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

## Discussion

Discussion There are no guarantees about the thread or queue on which the cancellation handler is invoked. After receiving a cancellation, the command’s completionHandler is invoked and no changes are applied.
