Use install.sh script first and specify the version that you want.
Look at https://github.com/MyNextID/cvc/releases to get the correct version example: v0.2.0
scripts/release.sh v0.1.3xcodebuild -create-xcframework \
-library lib/ios-device/arm64/libcvc.a \
-headers include/ \
-library lib/ios-simulator/arm64/libcvc.a \
-headers include/ \
-output cvc.xcframeworkThis guide explains how to distribute your XCFramework as a public Swift Package that can be consumed by iOS 18+ projects.
Your cvc.xcframework contains C library code with int128 support, which requires iOS 18+ devices. This guide will
help you:
- Prepare your XCFramework for distribution
- Create GitHub releases with proper assets
- Update your Package.swift for public consumption
- Tag and publish your package
- ✅ Your XCFramework is already built (
cvc.xcframework) - ✅ You have a GitHub repository:
https://github.com/MyNextID/cvc-swift - ✅ Swift Package Manager tools installed locally
- ✅ Write access to your GitHub repository
First, create a ZIP archive of your XCFramework from your project root:
# Navigate to your project directory (where cvc.xcframework exists)
cd /path/to/your/cvc-swift-project
# Create a ZIP file of your XCFramework
zip -r cvc.xcframework.zip cvc.xcframeworkWhy ZIP? Swift Package Manager requires binary targets to be distributed as ZIP files with specific checksums for security and integrity verification.
Generate the SHA256 checksum that Swift Package Manager requires:
# Compute the checksum (save this output for Step 4)
swift package compute-checksum cvc.xcframework.zipExample output:
a1b2c3d4e5f6789012345678901234567890abcdef1234567890abcdef123456
-
Go to your repository on GitHub:
https://github.com/MyNextID/cvc-swift -
Click on "Releases" (in the right sidebar or under the Code tab)
-
Click "Create a new release"
-
Fill out the release form:
- Tag version:
1.0.0(or your preferred version) - Release title:
v1.0.0 - Description: Brief description of your release
- Attach files: Drag and drop your
cvc.xcframework.zipfile
- Tag version:
-
Click "Publish release"
Result: Your ZIP file will now be available at:
https://github.com/MyNextID/cvc-swift/releases/download/1.0.0/cvc.xcframework.zip
Replace your current Package.swift with this updated version:
// swift-tools-version: 6.1
import PackageDescription
let package = Package(
name: "cvc-swift",
platforms: [
.iOS(.v18) // Required for int128 support
],
products: [
.library(
name: "cvc-swift",
targets: ["cvc-swift"])
],
targets: [
.binaryTarget(
name: "cvc",
url: "https://github.com/MyNextID/cvc-swift/releases/download/1.0.0/cvc.xcframework.zip",
checksum: "PASTE_YOUR_CHECKSUM_HERE"
),
.target(
name: "cvc-swift",
dependencies: ["cvc"]
),
.testTarget(
name: "cvc-swiftTests",
dependencies: ["cvc-swift"]
),
]
)Key changes:
- ✅
url: Points to your GitHub release ZIP file - ✅
checksum: ReplacePASTE_YOUR_CHECKSUM_HEREwith the checksum from Step 2 - ✅ Version in URL matches your GitHub release tag
# Add the updated Package.swift
git add Package.swift
# Commit the changes
git commit -m "Update Package.swift for public distribution v1.0.0"
# Create and push the tag (must match your GitHub release tag)
git tag 1.0.0
git push origin main --tagsWhy tag? The git tag must match your GitHub release tag so consumers can reference specific versions.
Test that your package works correctly:
# Resolve dependencies to verify the package works
swift package resolveIf successful, you should see output indicating the package resolved correctly.
Once published, developers can add your package to their iOS 18+ projects:
- File → Add Package Dependencies...
- Enter URL:
https://github.com/MyNextID/cvc-swift - Select version:
1.0.0(or latest) - Add to target
dependencies: [
.package(url: "https://github.com/MyNextID/cvc-swift", from: "1.0.0")
]import cvc_swift
// Your framework functions will be available hereWhen you need to release a new version (e.g., 1.1.0):
- Update your XCFramework (rebuild with new changes)
- Repeat Steps 1-2 (ZIP and compute new checksum)
- Create new GitHub release with tag
1.1.0 - Update Package.swift with new URL and checksum
- Commit and tag with
1.1.0
- Verify the import name matches your target name
- Check that iOS deployment target is 18.0+
- Ensure the checksum in Package.swift exactly matches the computed checksum
- Verify the ZIP file wasn't corrupted during upload
- Check that the GitHub release URL is publicly accessible
- Verify the tag exists in your repository
- Ensure the ZIP file is attached to the release
- iOS 18+ Requirement: Your package correctly specifies iOS 18+ due to int128 usage
- Public Distribution: Your package will be publicly available once published
- Versioning: Follow semantic versioning (major.minor.patch) for releases
- Security: Checksums ensure integrity - never skip this step
Your final repository should look like:
cvc-swift/
├── Package.swift # Updated with remote URL and checksum
├── Sources/
│ └── cvc-swift/ # Your Swift wrapper code
├── Tests/
│ └── cvc-swiftTests/ # Your test files
├── cvc.xcframework/ # Your built framework (local development)
└── README.md # This file
🎉 Success! Your XCFramework is now distributed as a Swift Package and ready for public consumption.