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

# swiftLanguageMode(_:_:)

Defines a `-language-mode` to pass  to the
corresponding build tool.

```
static func swiftLanguageMode(_ mode: SwiftLanguageMode, _ condition: BuildSettingCondition? = nil) -> SwiftSetting
```

## Parameters

`mode`

The Swift language mode to use.

`condition`

A condition that restricts the application of the build setting.

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

---

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)