The Problem with Objective-C
Until now, Kotlin Multiplatform code was exported to iOS through Objective-C headers. This worked, but it came with limitations:
- Objective-C doesn't support modern Swift features like optionals, generics, and value types
- iOS developers had to work with less idiomatic APIs
- Type safety was compromised at the language boundary
- Developer experience felt "foreign" to Swift developers
It was functional, but not ideal. iOS developers deserved better.
Enter Direct Kotlin-to-Swift Export
JetBrains laid the foundation in 2024 and released the first public version in May 2025. This wasn't just an incremental improvement – it was a fundamental reimagining of how Kotlin and Swift interoperate.
What Changes?
Direct Swift export means your Kotlin code will be exposed to iOS as native Swift APIs:
- Swift Optionals - Kotlin's nullable types map directly to Swift optionals
- Value Types - Kotlin data classes can become Swift structs
- Generics - Full generic support without type erasure
- Named Parameters - Kotlin's named parameters work naturally in Swift
- Enums with Associated Values - Better enum interoperability
Developer Experience Transformation
For iOS developers, this changes everything. Instead of:
// Old Objective-C export
let user = SharedUser(name: "John", email: nil)
if let email = user.email {
// email is NSString?, awkward...
}
You'll work with natural Swift code:
// New Swift export
let user = User(name: "John", email: nil)
if let email = user.email {
// email is String?, just like native Swift
}
The May 2025 Release
JetBrains achieved their goal: the first public version of direct Kotlin-to-Swift export launched in May 2025. This initial release delivered:
- A user experience superior to the existing Objective-C export
- Freedom from Objective-C constraints
- Broad Swift language support
- Seamless API exporting
Since the initial release, JetBrains has continued iterating to support more Kotlin features and edge cases throughout the year.
Impact on Team Collaboration
One of the biggest benefits of this change is improved collaboration between Android and iOS teams. When your shared Kotlin code looks and feels like natural Swift to iOS developers, adoption becomes much easier.
iOS developers won't feel like they're working with a "foreign" library anymore. The APIs will feel native, the types will make sense, and Xcode's autocomplete will actually be helpful.
SwiftPM Integration
Along with direct Swift export, JetBrains is introducing support for exporting frameworks with Swift Package Manager (SwiftPM). This means iOS developers can integrate your shared code using the same package manager they use for everything else.
No more manual framework imports. No more CocoaPods if you don't want it. Just add a package and you're done.
What We've Seen at Prospat
Since the public release, we've helped numerous clients adopt direct Swift export in their KMP projects. The improved iOS developer experience has made KMP adoption significantly smoother for companies with existing iOS teams.
iOS developers are enthusiastic about working with shared Kotlin code that appears as natural Swift APIs in Xcode. Several clients reported that their iOS teams now prefer working with the shared code over writing platform-specific implementations.
Ready to Leverage Swift Export?
Want to take advantage of direct Swift export in your KMP project? Contact us to discuss how we can help you build iOS apps that feel truly native while sharing maximum code with Android.