Binary Targets and XCFrameworks
Distributing closed-source code as XCFramework and consuming as a binary target.
What is a Binary Target?
A binary target distributes a precompiled framework (XCFramework) instead of source code, protecting proprietary implementations.
// Package.swift:
.binaryTarget(
name: "ClosedSDK",
path: "Frameworks/ClosedSDK.xcframework"
)What is an XCFramework?
An XCFramework bundles multiple platform slices (iOS, macOS, simulator) into a single distributable archive.
// XCFramework structure:
// ClosedSDK.xcframework/
// ├── ios-arm64/
// ├── ios-arm64_x86_64-simulator/
// └── macos-arm64_x86_64/