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

# upToNextMajor(from:)

A source control requirement bounded to the given version’s major version number.

```
static func upToNextMajor(from version: Version) -> Package.Dependency.Requirement
```

## Parameters

`version`

The minimum version for the version range.

## Return Value

A source control requirement instance.

## Discussion

Returns a requirement for a version range, starting at the given minimum
version and going up to but not including the next major version. This is the recommended
version requirement.

---

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)