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

# swiftLanguageVersion(_:_:)

Defines a `-swift-version` to pass  to the
corresponding build tool.

```
static func swiftLanguageVersion(_ version: SwiftVersion, _ condition: BuildSettingCondition? = nil) -> SwiftSetting
```

## Parameters

`version`

The Swift language version 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)