Hi all, I'm starting to look into creating a proof...
# multiplatform
a
Hi all, I'm starting to look into creating a proof of concept for migrating an existing native iOS and native Android app to KMP. Ideally I'll like to merge the 2 code bases and have them essentially running separately, and then refactor some logic to be shared. However, while there are a lot of resources about converting an android app to multiplatform, I can't really find anything super relevant for moving an existing iOS app to KMP, or moving from 2 native apps to one codebase for that matter. That makes me think there's something wrong with how I'm imagining this work going in the long run. How is one supposed to tackle a use case like this? What would make a good POC to see if this thing has legs and could work for us?
m
My approach would be to find some business logic that you would like to share. Ideally this would be something likely to change or where the two apps don't behave the same but they should. This makes it more worth actually porting. Often this will have some dependencies that will also have to be converted. All of this is easier if the Android app is modularized and you can port those modules that you want to KMP. In general I would focus on the domain models, repositories, and use cases. If things are working well maybe move up to the presentation logic. Then there's deciding if you want a shared UI or to stick with native UIs. For the two different codebases, #touchlab-tools built https://touchlab.co/kmmbridge-team-workflows for the iOS teams to consume the output. I've not used it, so I cannot give any feed back. Other option is to try and merge the two repositories into a single one. Should be possible to use git without losing any of the history and there's probably guides about monorepos that would list the steps.