<!--
{
  "availability" : [
    "SwiftPM: 6.2.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "PackageDescription",
  "identifier" : "/documentation/PackageDescription/SwiftSetting/defaultIsolation(_:_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Type Method",
  "symbol" : {
    "kind" : "Type Method",
    "modules" : [
      "PackageDescription"
    ],
    "preciseIdentifier" : "s:18PackageDescription12SwiftSettingV16defaultIsolationyACScMmSg_AA05BuildD9ConditionVSgtFZ"
  },
  "title" : "defaultIsolation(_:_:)"
}
-->

# defaultIsolation(_:_:)

Set the default isolation to the given global actor type.

```
static func defaultIsolation(_ isolation: MainActor.Type?, _ condition: BuildSettingCondition? = nil) -> SwiftSetting
```

## Parameters

`isolation`

The type of global actor to use for default actor isolation
inference. The only valid arguments are `MainActor.self` and `nil`.

`condition`

A condition that restricts the application of the build
setting.

## Discussion> Since: First available in PackageDescription 6.2.

The compiler defaults to inferring unannotated code as `nonisolated` if unspecified,
or if the `isolation` parameter is set to `nil`.

---

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)