This architecture is in development; Modaal does not scaffold it yet, and this page describes what it will ship.
How does it compare with the Kotlin Multiplatform flavor?
What does keeping two copies cost?
Every behavior change edits the Swift reducer and the Kotlin reducer, and both must replay the new recordings before CI passes. The Kotlin Multiplatform flavor writes the reducer once and renders it twice; What does sharing the logic cost? gives Modaal’s measured cost of a change shipped to both apps on that flavor. Choose Duet Twins when one of the reasons below outweighs the second edit.Who is it for?
- Teams where an iPhone developer and an Android developer each own their platform’s language, including the feature logic.
- Apps that must not link the Kotlin/Native runtime into the iPhone app.
- Apps with an Apple target that Kotlin/Native does not compile for.
What will ship?
- An iPhone-only Duet app on the Swift flavor can add a Kotlin core and an Android app.
- An Android-only Duet app can add a Swift core and an iPhone app.
- Per feature, the second copy is written against the recordings the first copy produced, so it has an executable specification before its first line.
- A feature may exist on one platform only; the manifest records which.
- A tutorial built on a two-core app ships with the release.
What can you do today?
- Start an iPhone app on the Swift flavor. Every feature it records becomes the specification a Kotlin copy will be checked against when the second core can be added.
- Pick the Kotlin Multiplatform flavor for one shared implementation of the logic with native SwiftUI and Jetpack Compose interfaces. The two Duet templates compares the two flavors you can create today.
Common questions
Is this two separate apps?
Is this two separate apps?
No. It is one repository with one manifest and one set of recordings. The iPhone app and the Android app each build from their own source tree in it, and CI checks both against the same recordings.
Does it use Kotlin Multiplatform?
Does it use Kotlin Multiplatform?
No. The Kotlin feature modules are plain Kotlin/JVM modules that the Android app compiles, and the iPhone app links no Kotlin.
Can I move a Kotlin Multiplatform project to two cores?
Can I move a Kotlin Multiplatform project to two cores?
That route is not planned for the first release.
Read next
Duet overview
The two Duet templates you can create today and how a feature gets built.
Should you share code between iOS and Android?
The three ways to ship two apps, and what each can prove about behavior.
Kotlin/Native GC and Swift ARC
What the Kotlin Multiplatform flavor links into the iPhone app.
Duet glossary
Twin, coexistence window, recording and the other terms on this page.