In this video, I will guides you through the process of integrating a ViewModel in a Kotlin Multiplatform project using Koin. You’ll learn how to set up the necessary dependencies, configure the build.gradle.kts file for different platforms, and instantiate the ViewModel for Android, iOS, and JVM. This tutorial is a continuation of the previous video, so make sure to watch that first. Links to the previous video and the GitHub repository are in the description. Happy coding!
Timecodes
0:00 Intro
0:58 Dependencies
1:55 ViewModel
2:32 Dependency Injection
3:24 Scoped
4:02 Final Step
4:24 Desktop
4:31 iOS
4:47 Android
**Source Code:** https://github.com/pererikbergman/kmp-viewmodel
**Philipp Lackner:** https://youtu.be/O85qOS7U3XQ?si=9k4OAbBlpUQ65uJG&t=1336