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
- Enable Compose Multiplatform
- Layouts, Modifiers & Theming
- State & Recomposition in Shared UI
- Host Shared UI on iOS & Desktop