---
title: "Kotlin Swift Export is in Alpha: what works, and should you use it?"
description: "Kotlin Swift Export turns suspend functions into async and Flow into AsyncSequence. Here's what works in Kotlin 2.4.20 and if it's ready."
author: "MH TOUFIK"
published: 2026-11-20T05:25:00.000Z
updated: 2026-11-14T05:25:23.000Z
url: https://toufik.dev/blog/kotlin-swift-export-alpha
category: "Cross-Platform"
tags: ["KMP iOS", "Kotlin 2.4", "Kotlin Multiplatform", "Swift Export", "Swift interop"]
---

# Kotlin Swift Export is in Alpha: what works, and should you use it?

For years, calling Kotlin from Swift meant going through **Objective-C**. Your `suspend` functions became completion handlers, Kotlin enums became plain classes, and Swift developers saw odd names like `SharedKt`.

**Swift Export** removes that middle step. It reached **Alpha in Kotlin 2.4.0** in June 2026, and **Kotlin 2.4.20** (**7 September 2026**) added more. Here's what works today, what doesn't, and whether you should switch.

## What Swift Export actually does

Normally, Kotlin/Native generates an Objective-C header, and Swift reads that header. Anything Objective-C can't express gets flattened or lost on the way.

Swift Export skips the header. Kotlin exports your code **directly to Swift**, so iOS code calls your shared module the way it calls any Swift library.

It's **opt-in**. Your existing projects keep using Objective-C export until you turn it on.

## Change 1: suspend functions become async

This is the big one. With Swift Export, a Kotlin `suspend` function shows up in Swift as a normal **async** function.

```kotlin
suspend fun hello(): String {
    delay(1000)
    return "Hello from Kotlin"
}
```

```swift
let msg = try await hello()
```

No callbacks and no wrapper library. Swift developers write the same `try await` they already use everywhere else.

## Change 2: Flow becomes AsyncSequence

Before this, exposing a Kotlin `Flow` to Swift needed a **third-party library**, such as KMP-NativeCoroutines or SKIE.

Swift Export now maps `kotlinx.coroutines` flows to Swift's **AsyncSequence** out of the box. Type information is kept, so a `Flow<String>` arrives in Swift as a sequence of `String`.

If a `Flow` drives your iOS screens, this removes a whole layer of glue code.

## Change 3: sealed classes and Swift subclasses

Kotlin 2.4.20 added two more pieces.

**Sealed classes and interfaces** now map to Swift enums through a `sealedType()` method. You can write an exhaustive `switch` without a `default` case, and the compiler warns you when someone adds a new subclass.

**Cross-language inheritance** lets Swift classes implement Kotlin interfaces. You define a contract in Kotlin, implement it in Swift with something like CryptoKit, and pass it back to your shared code.

The same release also generates a **Package.swift** file next to your XCFramework, which makes SwiftPM distribution easier.

## What "Alpha" means for your app

JetBrains is clear about this. The docs say Swift Export is **in Alpha and still incomplete**, and breaking changes are expected. Alpha also says nothing about when it will reach Stable.

There are smaller gotchas too. Kotlin `Int` maps to Swift **`Int32`**, not Swift's 64-bit `Int`, so your iOS code may need conversions in places.

So my view is simple. Try it in a branch. Don't ship a client's app on it yet.

Turning it on starts with one Gradle block in your shared module:

```kotlin
kotlin {
    iosArm64()
    iosSimulatorArm64()
    swiftExport {
        moduleName = "Shared"
    }
}
```

Follow the official Swift Export page for the Xcode build step, because the setup has changed between releases.

## Your checklist

1. **Update to Kotlin 2.4.20 or newer.** Sealed class and inheritance support starts in this version.
2. **Create a test branch.** Keep your production build on Objective-C export for now.
3. **Enable Swift Export in one module.** Start small, not with the whole app.
4. **List your suspend and Flow APIs.** That's where you'll see the biggest gain, and where wrapper libraries could go later.
5. **Check your Int types.** Look for places where Swift expects `Int` and now gets `Int32`.
6. **Write down what breaks.** Missing features and odd names are worth reporting on YouTrack.
7. **Re-test on every Kotlin update.** Alpha means the generated API can change between versions.

## My take

Swift Export is the biggest iOS improvement Kotlin Multiplatform has had in years. It makes your shared code feel like a Swift library, not a foreign framework.

But it's Alpha. Learn it now, so you're ready the day it turns Stable.

## Sources

- [What's new in Kotlin 2.4.20](https://kotlinlang.org/docs/whatsnew2420.html) — Kotlin
- [What's new in Kotlin 2.4.0](https://kotlinlang.org/docs/whatsnew24.html) — Kotlin
- [Interoperability with Swift using Swift export](https://kotlinlang.org/docs/native-swift-export.html) — Kotlin
- [Kotlin 2.4.0 Released](https://blog.jetbrains.com/kotlin/2026/06/kotlin-2-4-0-released/) — JetBrains
- [Kotlin 2.4.20 Released](https://blog.jetbrains.com/kotlin/2026/09/kotlin-2-4-20-released/) — JetBrains

