https://github.com/touchlab/compose-swiftui-codelab
https://github.com/touchlab/compose-swiftui-codelab
Last synced: 8 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/touchlab/compose-swiftui-codelab
- Owner: touchlab
- Created: 2024-05-15T19:17:12.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2024-06-28T15:59:59.000Z (over 1 year ago)
- Last Synced: 2025-06-02T22:51:13.771Z (10 months ago)
- Language: Kotlin
- Size: 220 KB
- Stars: 34
- Watchers: 6
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Multiplatform Compose + SwiftUI = The Native App Future
In this codelab, we will look in KMP's killer feature, interop! Compose and SwiftUI can work together.
Render “native” UI or shared Compose UI, with the same underlying logic.
Make more UI “native”, or build more features with shared UI, and make those decisions incrementally.
## Requirements
You will need the following:
- JVM 17
- Android SDK and the latest stable Android Studio (2023.3+)
- Mac with Xcode 15.1+ for the iOS build
You can validate if everything is setup properly by using [kdoctor](https://github.com/Kotlin/kdoctor).
## Getting Started
Clone this repository at your machine
`git clone git@github.com:touchlab/compose-swiftui-codelab.git`
Once cloned, open the project in Android Studio. Wait for Gradle to complete sync and run the Android app.
Next, open `iosApp/iosApp.xcodeproj` in Xcode or execute in terminal `xed iosApp/`. Run the project in a real device or iOS Simulator.
On Android, we will use Google Maps, it requires setup the Maps Key on the `gradle.properties`. [Google Maps Documentation for setup key](https://developers.google.com/maps/documentation/android-sdk/get-api-key)
`MAPS_API_KEY=Your Api Key`
## Stack
- [Compose KMP](https://github.com/JetBrains/compose-multiplatform)
- [Voyager](https://github.com/adrielcafe/voyager) for Compose Multiplatform navigation
- [Jetpack ViewModel KMP](https://www.jetbrains.com/help/kotlin-multiplatform-dev/compose-lifecycle.html#viewmodel-implementation) recently announced ViewModel KMP with Voyager experimental support
- [SKIE](https://github.com/touchlab/SKIE) Swift friendly API