Hello everyone :wave: quick question. How much log...
# multiplatform
m
Hello everyone 👋 quick question. How much logic do you actually reuse with Multiplatform? Do you reuse everything up to ViewModels/Presenters (including ViewModels/Presenters)? Do you reuse only data and domain part, but leave presentation logic up to the platforms? Or do you reuse only simple computations? Approach that kind of works best and gives the most flexibility for me is reusing data and domain layer. Basically: giving iOS, Android and Web use cases and domain models they can use, but they write presentation logic (presenters, viewmodels, controllers) on their own and use converter functions that transform callbacks into reactive functions. I would like to hear your opinions on usage.
j
For me, I tried to have an application where I shared the viewmodel along with repositories and api calls, but ultimately that didn't work out well for me. On the iOS side I need to not just rely on the shared data models as I need Observable Object and to be able to use the Published annotation, so I have a middle layer on the iOS to translate from what is shared to what SwiftUI needs, so I share data models, the repository and web service calls, and that is currently it.
m
yeah, similar with me. having everything up to usecase (domain layer) was the best fit. thanks for the answer 🙂