This guide walks you through compiling the IMGLYUI Swift dependency and its dependencies into a XCFramework usable for Xcode builds without internet access or Swift Package Manager access.
Requirements#
To work with the SDK, you’ll need:
- A Mac running a recent version of Xcode
- macOS Tahoe (26) or newer, as required by Scipio
- Your application project for reference
Install Scipio#
We will make use of the Scipio tool, which automates the process of building XCFrameworks from Swift Package Manager dependencies.
You can install Scipio with standard Swift package management tools such as nest, Mint or directly from source:
nest install giginet/Scipioscipio --help# Ormint install giginet/Scipiomint run scipio --help# Orgit clone https://github.com/giginet/Scipio.gitcd Scipioswift run -c release scipio --helpPrepare a dummy Swift Package Manager project to pull in all the dependencies for precompilation#
First, create an empty directory somewhere and create a Package.swift file inside with the following contents:
// swift-tools-version: 6.1import PackageDescription
// Dummy package to bundle dependencies as a precompiled XCFrameworklet package = Package( name: "DummyApp", // Match the app target version here platforms: [.iOS(.v16)], products: [ .library(name: "DummyApp", targets: ["DummyApp"]) ], // Custom dependencies can be added here dependencies: [ .package(url: "https://github.com/imgly/IMGLYUI-swift.git", exact: "1.64.0"), // If you use these libraries in your app, make sure to match exact versions here .package(url: "https://github.com/siteline/SwiftUI-Introspect.git", exact: "26.0.0"), .package(url: "https://github.com/onevcat/Kingfisher.git", exact: "8.5.0"), ], targets: [ .target( name: "DummyApp", // Make sure to add any custom packages to the list here too dependencies: [.product(name: "IMGLYUI", package: "IMGLYUI-swift")] ) ])You can tweak the dependency lists and versions as needed to precompile all your project dependencies into XCFramework bundles.
Then, create an empty source file in Sources/DummyApp/DummyApp.swift to match the package definition.
Make sure the Swift package builds by running xcodebuild in the package directory:
xcodebuild -scheme DummyApp -destination 'platform=iOS Simulator,arch=arm64,OS=26.0,name=iPhone SE (3rd generation)' buildCompile XCFrameworks for all the dependencies with Scipio#
Run the following command to create a mergeable XCFramework for every dependency of the project: (including transitive dependencies)
scipio prepare --support-simulators --framework-type mergeable --enable-library-evolution --overwriteUse the resulting XCFrameworks#
The resulting frameworks are located in the XCFrameworks subdirectory by default, and can be added to Xcode projects as dependencies.