0Pricing
Kotlin Multiplatform Academy · Lesson

Host Shared UI on iOS & Desktop

Embed the same composables in each target.

Same App, New Hosts

Your shared App composable is ready. Now each platform needs a small entry point that mounts it. The UI code itself never changes.

iOS Wraps Compose in a Controller

On iOS you expose your composable through a UIViewController. The function ComposeUIViewController hands SwiftUI a controller it can present.

fun MainViewController() =
    ComposeUIViewController { App() }

All lessons in this course

  1. Enable Compose Multiplatform
  2. Layouts, Modifiers & Theming
  3. State & Recomposition in Shared UI
  4. Host Shared UI on iOS & Desktop
← Back to Kotlin Multiplatform Academy