package(id:exact:)

    Adds a package dependency that uses the exact version requirement.

    PackageDependency.swift:604
    SwiftPM
    5.7+
    static func package(id: String, exact version: Version) -> Package.Dependency

    Parameters

    id

    The identity 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 multiple other packages depend on a package. Because 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(id: "scope.name", exact: "1.2.3"),

    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