Direct integration

Edit pageLast modified: 03 March 2025

If you want to develop your Kotlin Multiplatform project and an iOS project simultaneously by sharing code between them, you can set up direct integration using a special script.

This script automates the process of connecting the Kotlin framework to iOS projects in Xcode:

Direct integration diagram

The script uses the embedAndSignAppleFrameworkForXcode Gradle task designed specifically for the Xcode environment. During the setup, you add it to the run script phase of the iOS app build. After that, the Kotlin artifact is built and included in the derived data before running the iOS app build.

In general, the script:

  • Copies the compiled Kotlin framework into the correct directory within the iOS project structure.

  • Handles the code signing process of the embedded framework.

  • Ensures that code changes in the Kotlin framework are reflected in the iOS app in Xcode.