package(url:exact:)

    Adds a package dependency that uses the exact version requirement.

    PackageDependency.swift:500
    SwiftPM
    5.6+
    static func package(url: String, exact version: Version) -> Package.Dependency

    Parameters

    url

    The valid Git URL of the package.

    version

    The exact version of the dependency for this requirement.

    Returns

    A Package.Dependency instance.

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

    The following example instructs the Swift Package Manager to use version 1.2.3.

    .package(url: "https://example.com/example-package.git", exact: "1.2.3"),

    See also

    Other members in extension

    Types

    Show obsolete interfaces (1)

    Hide obsolete interfaces

    • enum Requirement

      An enum that represents the requirement for a package dependency.

    Type members

    Show obsolete interfaces (7)

    Hide obsolete interfaces

    Instance members

    Show obsolete interfaces (3)

    Hide obsolete interfaces