Hey everyone, just wondering if you've used Androi...
# multiplatform
z
Hey everyone, just wondering if you've used Android Studio to create a new KMM App, is it easy to break out the shared module later? Is it easy to add a new KMM library to the project structure?
p
Usually it’s straight forward if you properly modularize your code. There are some things which naturally happen due to the development of an android app which make the migration a little painful; and that is what dependencies you chose. So if you plan to go with kmp I suggest that you strictly check, what’s ready for multiplatform. So for instance: java.time -> kotlinx.time room -> sqldelight dagger -> kotlininject …
z
Great, thank you! I'm anticipating us starting with an iOS + Android app with models and core business logic in
shared
and in the future having a new app for a different set of users that depends on the same models in the shared module
p
@Zayaan Actually there are some factors I’d take into account here which are specific to the interop. As your framework headers will be in objc, constructs have limitations if they are public api’s • Enums are not swift enums • Sealed classes are regular classes and lose their exhaustiveness • Generics in interfaces get wiped • … So I would actually suggest to do some research and come up with some best practices on how to structure the public API of your shared code