<!--
{
  "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.property",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Property",
  "symbol" : {
    "kind" : "Instance Property",
    "modules" : [
      "Swift"
    ],
    "preciseIdentifier" : "s:ScT11isCancelledSbvp"
  },
  "title" : "isCancelled"
}
-->

# isCancelled

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

```
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.

This property returns the actual cancellation state of the task, regardless of whether
a cancellation shield is active. Use [`isCancelled`](/documentation/Swift/Task/isCancelled-swift.type.property) (the static property)
if you need cancellation checking that respects active shields.

### Instance property isCancelled ignores Task Cancellation Shields

The instance property [`isCancelled`](/documentation/Swift/Task/isCancelled-swift.property)
is not contextual and therefore does not respect cancellation shields.
If a task was cancelled and is executing with an active cancellation shield,
these properties will return the *actual* cancellation status of the specific task.

Prefer using [`isCancelled`](/documentation/Swift/Task/isCancelled-swift.type.property) (the static property) in most situations when checking
the cancellation status from inside the task.

> SeeAlso: ```Task/isCancelled-type.property``

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

> SeeAlso: ``doc://com.apple.Swift/documentation/Swift/Task/hasActiveCancellationShield``

> 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)