Swift package export setup

Edit pageLast modified: 03 March 2025

You can set up the Kotlin/Native output for an Apple target to be consumed as a Swift package manager (SPM) dependency.

Consider a Kotlin Multiplatform project that has an iOS target. You may want to make this iOS binary available as a dependency to iOS developers working on native Swift projects. Using Kotlin Multiplatform tooling, you can provide an artifact that would seamlessly integrate with their Xcode projects.

This tutorial shows how to do this by building XCFrameworks with the Kotlin Gradle plugin.