Hey :wave: . Does someone share viewmodel for mobi...
# multiplatform
p
Hey 👋 . Does someone share viewmodel for mobile and web/desktop, what’s the best architecture to try and are there some examples to learn from? I already saw D-KMP, but want to check more solutions, maybe you already have some. Thanks!
a
p
@Arkadii Ivanov Thanks, I found Decompose useful for me. Just one more question - I see that there are some extensions for jetpack compose for animations. Is that something people need to wait for swiftUI or we can create them in native UI frameworks? Not sure what’s animations role in this framework
a
Unfortunately it seems it is not possible to create something for SwiftUI that would connect to a Kotlin library. So for now you will need to do SwiftUI animations manually. Same for view state preservation when navigating backward. You can check how iOS animations are implemented in this example, and derive yours. For view state preservation, one of the ways is to just show all the backstack views one on top another with a solid background colour.
🙏 1
m
@Pavlo Huk Very simple and naive approach, maybe it will be useful for you https://github.com/michalharakal/kmp-workshop/tree/main/dukecon/code