<!--
{
  "availability" : [
    "iOS: 17.0.0 -",
    "iPadOS: 17.0.0 -",
    "macCatalyst: 17.0.0 -",
    "macOS: 14.0.0 -",
    "tvOS: 17.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 10.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Swift",
  "identifier" : "/documentation/Swift/DiscardingTaskGroup/isCancelled",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Property",
  "symbol" : {
    "kind" : "Instance Property",
    "modules" : [
      "Swift"
    ],
    "preciseIdentifier" : "s:12_Concurrency19DiscardingTaskGroupV11isCancelledSbvp"
  },
  "title" : "isCancelled"
}
-->

# isCancelled

A Boolean value that indicates whether the group was canceled.

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

## Discussion

To cancel a group, call the `DiscardingTaskGroup.cancelAll()` method.

If the task that’s currently running this group is canceled,
the group is also implicitly canceled,
which is also reflected in this property’s value.

### 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: ``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)