<!--
{
  "availability" : [
    "iOS: 18.0.0 -",
    "iPadOS: 18.0.0 -",
    "macCatalyst: 18.0.0 -",
    "macOS: 15.0.0 -",
    "tvOS: 18.0.0 -",
    "visionOS: 2.0.0 -",
    "watchOS: 11.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Swift",
  "identifier" : "/documentation/Swift/UnsafeCurrentTask/unownedTaskExecutor",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Property",
  "symbol" : {
    "kind" : "Instance Property",
    "modules" : [
      "Swift"
    ],
    "preciseIdentifier" : "s:Sct19unownedTaskExecutor12_Concurrency07UnownedbC0VSgvp"
  },
  "title" : "unownedTaskExecutor"
}
-->

# unownedTaskExecutor

The current [`TaskExecutor`](/documentation/Swift/TaskExecutor) preference, if this task has one configured.

```
var unownedTaskExecutor: UnownedTaskExecutor? { get }
```

## Discussion

The executor may be used to compare for equality with an expected executor preference.

The lifetime of an executor is not guaranteed by an [`UnownedTaskExecutor`](/documentation/Swift/UnownedTaskExecutor),
so accessing it must be handled with great case – and the program must use other
means to guarantee the executor remains alive while it is in use.

---

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)