1
0
Fork
You've already forked cmp
0
Embedded SwiftUI view in Compose Multiplatform example
  • Kotlin 77.9%
  • Swift 19.8%
  • HTML 1.8%
  • CSS 0.5%
Ivan Schuetz 30f47e14e6 Use koin
Added <platform> suffix to Modules/Constants platform specific filenames because of this error when running the Android app:
Duplicate JVM class name 'com/schuetz/di/ModulesKt' generated from: ModulesKt, ModulesKt
Curiously, it didn't happen with Deps.kt (now removed) before
2025年05月19日 14:05:29 +02:00
composeApp Use koin 2025年05月19日 14:05:29 +02:00
gradle Use koin 2025年05月19日 14:05:29 +02:00
img Add readme 2025年05月18日 19:51:47 +02:00
iosApp Use koin 2025年05月19日 14:05:29 +02:00
kotlin-js-store Add (manual) dependency management 2025年05月15日 07:53:22 +02:00
server Improve websocket name 2025年05月18日 15:06:39 +02:00
shared Initial import 2025年05月14日 13:56:59 +02:00
.gitignore Initial import 2025年05月14日 13:56:59 +02:00
build.gradle.kts Initial import 2025年05月14日 13:56:59 +02:00
gradle.properties Initial import 2025年05月14日 13:56:59 +02:00
gradlew Initial import 2025年05月14日 13:56:59 +02:00
gradlew.bat Initial import 2025年05月14日 13:56:59 +02:00
LICENSE Add license 2025年05月18日 20:11:31 +02:00
README.md Add readme 2025年05月18日 19:51:47 +02:00
settings.gradle.kts Initial import 2025年05月14日 13:56:59 +02:00

Embedded SwiftUI view in Compose Multiplatform example

screenshot

This example shows a SceneKit 3d model in SwiftUI embedded in a Compose Multiplatform view, being rotated by websocket events.

In more detail:

  • Websocket server sends random numbers to the client
  • On iOS, the websocket numbers are used to animate the 3d model's rotation
  • On other platforms, the view is a text label that displays the websocket numbers

I did this to explore embedding native iOS views in Compose Multiplatform, and bidirectional control flow.

Run:

Start the server

./gradlew :server:run

Then start any of the apps.