Ok… so i finally got as far as creating a kmp modu...
# multiplatform
j
Ok… so i finally got as far as creating a kmp module, importing all my ktor and repositories over, as well as some stateholders and one viewmodel. Seems to work really well so far. The hope is to for now keep the views as Is but replace all the ios viewmodels with my kmp ones. I have some questions about lifecycle management- im using koin but will it know the right lifecycles for viewmodels in ios? How does that work? Also im curious to see preferred ways to observe changes on a vm- i saw some stuff from chat gpt where you can write a extension function to make the stateflow observable and post new values to the @published vars on ios. Is that the right thing? Is stateflow the correct way? Right now we were usng mutable state so id prefer to keep that if its good enough/possible
I believe you would have to provide the implementation from swift to a Koin module using a swift factory bridge. Because otherwise I am not sure how Koin will know the ViewModel Lifecycle on iOS side. You can share a link to this thread in #C67HDJZ2N