Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

276
Views
SPM dependencies branch is deprecated on Xcode 13.3 and Swift 5.6

Xcode 13.3 shows warnings for deprecation on the dependencies for external packages.

For example:

// swift-tools-version:5.6
import PackageDescription

let package = Package(
    name: "MyPackage",
    platforms: [
        .iOS(.v15)
    ],
    products: [
        .library(
            name: "MyPackage",
            targets: ["MyTarget"]),
    ],
    dependencies: [
        .package(
            name: "MyDependency", 
            url: "https://github.com/someorg/somepackage.git",
            .branch("main"))
    ],
    targets: [
        .target(
            name: "MyTarget",
            dependencies: ["MyDependency"])
    ]
)

This shows the warning:

'package(name:url:_:)' is deprecated: use specific requirement APIs instead (e.g. use 'branch:' instead of '.branch')

However applying the recommended update makes the dependency not reachable anymore from MyPackage.

over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

It is necessary to set the dependency as a product.

Specifically with .product(name: [PackageName], package: [Name of repository]), example:

// swift-tools-version:5.6
import PackageDescription

let package = Package(
    name: "MyPackage",
    platforms: [
        .iOS(.v15)
    ],
    products: [
        .library(
            name: "MyPackage",
            targets: ["MyTarget"]),
    ],
    dependencies: [
        .package(
            url: "https://github.com/someorg/somepackage.git",
            branch: "main")
    ],
    targets: [
        .target(
            name: "MyTarget",
            dependencies: [
                .product(
                    name: "MyDependency", 
                    package: "somepackage")])
    ]
)
over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!