library(name:type:targets:)

    Creates a library product to allow clients that declare a dependency on this package to use the package’s functionality.

    Product.swift:138
    static func library(name: String, type: Library.LibraryType? = nil, targets: [String]) -> Product

    Parameters

    name

    The name of the library product.

    type

    The optional type of the library that’s used to determine how to link to the library. Leave this parameter so Swift Package Manager can choose between static or dynamic linking (recommended). If you don’t support both linkage types, use static or dynamic for this parameter.

    targets

    The targets that are bundled into a library product.

    Returns

    A Product instance.

    A library’s product can be either statically or dynamically linked. It’s recommended that you don’t explicitly declare the type of library, so Swift Package Manager can choose between static or dynamic linking based on the preference of the package’s consumer.

    See also

    Other members in extension

    Types

    Type members

    Instance members