I am working on a Application in KMM, please sugge...
# compose-android
a
I am working on a Application in KMM, please suggest any good resource how to use same viewModel in android and in IOS where UI component are to shared with each other
j
Just add the ViewModel dependency from JetBrains to your commonMain target.
Copy code
androidx-lifecycle-viewmodel = { group = "org.jetbrains.androidx.lifecycle", name = "lifecycle-viewmodel", version.ref = "androidx-lifecycle" }
c
Also please don’t call it KMM any more. That abbreviation is deprecated for years now. 😊 https://blog.jetbrains.com/kotlin/2023/07/update-on-the-name-of-kotlin-multiplatform/