Sunday, July 3, 2022
HomeiOS Developmentios - CocoaPods: supporting binary xcframework dependencies like SPM's `binaryTarget`

ios – CocoaPods: supporting binary xcframework dependencies like SPM’s `binaryTarget`


I have a library using Swift Package Manger (SPM) but I need to support CocoaPods and I'm getting stuck figuring out how to support a binary xcframework dependency. SPM allows hosting a binary xcframework like the following Package.swift example below.

How can I do this with CocoaPods?

import PackageDescription

let package = Package(
    name: "MyPackage",
    defaultLocalization: "en",
    platforms: [.iOS(.v12)],
    products: [
        .library(
            name: "MyLibrary",
            targets: ["MyTarget"])
    ],
    targets: [
        .target(
            name: "MyTarget",
            dependencies: ["BinaryTarget"],
            path: "Sources/"
        ),
    .binaryTarget(
        name: "BinaryTarget",
        url: "https://someplace.com/public/BinaryTarget.xcframework.zip",
        checksum: "123abcxyz"
        )
    ]
)

I did find this issue https://github.com/CocoaPods/CocoaPods/issues/5903 but hoping there is a solution. Do all dependencies in CocoaPods need a Podfile?

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Most Popular

Recent Comments