---
title: isCancelled
framework: swift
role: symbol
role_heading: Type Property
path: swift/task/iscancelled-swift.type.property
---

# isCancelled

A Boolean value that indicates whether the task should stop executing.

## Declaration

```swift
static var isCancelled: Bool { get }
```

## Discussion

Discussion After the value of this property becomes true, it remains true indefinitely. There is no way to uncancel a task. Interaction with Task Cancellation Shields Cancellation may be suppressed by an active task cancellation shield (withTaskCancellationShield(operation:)), which may cause isCancelled to return false even though the task has been cancelled externally. note: checkCancellation() note: withTaskCancellationShield(operation:)

## See Also

### Canceling Tasks

- [CancellationError](swift/cancellationerror.md)
- [cancel()](swift/task/cancel().md)
- [isCancelled](swift/task/iscancelled-swift.property.md)
- [checkCancellation()](swift/task/checkcancellation().md)
- [withTaskCancellationHandler(handler:operation:)](swift/withtaskcancellationhandler(handler:operation:).md)
- [withTaskCancellationHandler(operation:onCancel:isolation:)](swift/withtaskcancellationhandler(operation:oncancel:isolation:).md)
