> ## Documentation Index
> Fetch the complete documentation index at: https://docs.modaal.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Duet Twins: a Swift Core for iPhone, a Kotlin Core for Android

> Coming to Duet: each app runs its own feature logic, Swift on iPhone and Kotlin on Android, and one set of recorded behavior checks both copies in CI.

<Note>
  This architecture is in development; Modaal does not scaffold it yet, and this page describes what it will ship.
</Note>

A Duet Twins project keeps each feature's logic twice: as a Swift reducer the iPhone app runs, and as a Kotlin reducer the Android app runs. Both reducers replay the same recorded fixtures in CI. A feature whose two copies disagree fails the check on the side that differs, with the fixture bytes that side produced.

## How does it compare with the Kotlin Multiplatform flavor?

| | Duet Twins | Kotlin Multiplatform flavor |
| - | - | - |
| What the iPhone app runs | Swift reducers | the Kotlin core, through a Kotlin/Native framework |
| What the Android app runs | Kotlin reducers | the same Kotlin core |
| What the two apps share | the recordings | the core and the recordings |
| Kotlin/Native in the iPhone app | none | the runtime and its collector ([Kotlin/Native GC and Swift ARC](/articles/kotlin-native-gc-swift-arc)) |
| iPhone build | Xcode only | Xcode plus the core's assemble step |
| Reducers edited per behavior change | two, one per language | one |
| Apple targets that Kotlin/Native does not compile for | supported | not available |

## 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?](/articles/share-code-ios-android#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.

This page gives no dates.

## 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](/articles/duet#the-two-duet-templates) compares the two flavors you can create today.

## Common questions

<AccordionGroup>
  <Accordion title="Is this two separate apps?" icon="code-branch">
    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.
  </Accordion>

  <Accordion title="Does it use Kotlin Multiplatform?" icon="k">
    No. The Kotlin feature modules are plain Kotlin/JVM modules that the Android app compiles, and the iPhone app links no Kotlin.
  </Accordion>

  <Accordion title="Can I move a Kotlin Multiplatform project to two cores?" icon="arrow-right-arrow-left">
    That route is not planned for the first release.
  </Accordion>
</AccordionGroup>

## Read next

<CardGroup cols={2}>
  <Card title="Duet overview" icon="mobile-screen-button" href="/articles/duet">
    The two Duet templates you can create today and how a feature gets built.
  </Card>

  <Card title="Should you share code between iOS and Android?" icon="share-nodes" href="/articles/share-code-ios-android">
    The three ways to ship two apps, and what each can prove about behavior.
  </Card>

  <Card title="Kotlin/Native GC and Swift ARC" icon="memory" href="/articles/kotlin-native-gc-swift-arc">
    What the Kotlin Multiplatform flavor links into the iPhone app.
  </Card>

  <Card title="Duet glossary" icon="book" href="/articles/duet-glossary">
    Twin, coexistence window, recording and the other terms on this page.
  </Card>
</CardGroup>


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.