Hi All, Looking for an information for new project...
# multiplatform
a
Hi All, Looking for an information for new project. - what is the percent of KMM code can we share in a iOS/Android project with clean architecture. Is anyone willing to share in their experience how much percent reuse you achieved?
t
Hard to say. It will depend on how much business logic the application will contain. The UI will need to be implemented for each platform, but you can share view models. I recommend looking at some of the samples like KaMPKit or PeopleInSpace to see how much is shared. https://kotlinlang.org/docs/multiplatform-mobile-samples.html
a
Thanks, I looked at some sample projects and found 60%kmm, 40%android, 40%iOS, does it match real projects?
t
I haven't finished our project yet, so I don't know our percentages. I think ours will be better than 60% though. Probably closer to 70%.
m
For us it’s between 65-70% Kotlin, shared VMs and clean architecture.
s
Same, started off with separate platform specific viewmodels for flexibility but quickly realised there was no point. So now pretty much everything except UI is common Kotlin code. Our approach is to use a state driven approach where viewmodels each have a sealed class representing view state which we convert to a swift enum using https://github.com/icerockdev/moko-kswift It's working well so far
a
Thanks all, We will also have to explore shared VMs.