<!--
{
  "availability" : [
    "SwiftPM: -"
  ],
  "documentType" : "symbol",
  "framework" : "PackageDescription",
  "identifier" : "/documentation/PackageDescription/Package/Dependency/Requirement-swift.enum/exact(_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Type Method",
  "symbol" : {
    "kind" : "Type Method",
    "modules" : [
      "PackageDescription"
    ],
    "preciseIdentifier" : "s:18PackageDescription0A0C10DependencyC11RequirementO5exactyAgA7VersionVFZ"
  },
  "title" : "exact(_:)"
}
-->

# exact(_:)

Returns a requirement for the given exact version.

```
static func exact(_ version: Version) -> Package.Dependency.Requirement
```

## Parameters

`version`

The exact version of the dependency for this requirement.

## Discussion

Specifying exact version requirements are not recommended as they can
cause conflicts in your dependency graph when multiple other packages
depend on a package. As Swift packages follow the semantic versioning
convention, think about specifying a version range instead.

The following example defines a version requirement that requires
version 1.2.3 of a package.

```swift
.exact(“1.2.3”)
```

---

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)