Contents

byName(name:condition:)

Creates a dependency that resolves to either a target or a product with the specified name.

Declaration

static func byName(name: String, condition: TargetDependencyCondition? = nil) -> Target.Dependency

Parameters

  • name:

    The name of the dependency, either a target or a product.

  • condition:

    A condition that limits the application of the target dependency. For example, only apply a dependency for a specific platform.

Return Value

A Target.Dependency instance.

Discussion

Swift Package Manager creates the by-name dependency after it has loaded the package graph.

See Also

Creating a Target Dependency