<!--
{
  "availability" : [
    "iOS: 13.0.0 -",
    "iPadOS: 13.0.0 -",
    "macCatalyst: 13.0.0 -",
    "macOS: 10.15.0 -",
    "tvOS: 13.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 6.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Swift",
  "identifier" : "/documentation/Swift/Task/isCancelled-swift.type.property",
  "metadataVersion" : "0.1.0",
  "role" : "Type Property",
  "symbol" : {
    "kind" : "Type Property",
    "modules" : [
      "Swift"
    ],
    "preciseIdentifier" : "s:ScT12_Concurrencys5NeverORszACRs_rlE11isCancelledSbvpZ"
  },
  "title" : "isCancelled"
}
-->

# isCancelled

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

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

## 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:)-(()->Value)`), which may cause `isCancelled`
to return `false` even though the task has been cancelled externally.

> SeeAlso: ``doc://com.apple.Swift/documentation/Swift/Task/checkCancellation()``

> SeeAlso: ``withTaskCancellationShield(operation:)-(()->Value)``

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)