RANJAN
11/23/2025, 8:39 PMcomposeApp and shared modules. and shared would be containing logic till domain layer.
But after migrating my application to domain and started composeApp module with UI and viewmodel I realised in composeApp don't have way for viewmodel to be initialised via koin.(If have way then please let me know)
But now when we create new project using KMP plugin it do not provide shared module instead official documentation suggest to put shared logics in same module too.
My question: is KMP really stable. without knowing it changed a lot in 4-5 months for me. Can it be trusted.Max
11/23/2025, 10:11 PMRANJAN
11/24/2025, 1:55 AMMax
11/24/2025, 7:25 AMcomposeApp and shared module:
You want compose UI on all plattforms? --> ViewModels in composeApp is fine
You want native UI on some plattform which only consumes ViewModels and renders native UI -> ViewModels in shared (so you can just depend on shared, and are not forced to add dependency on composeApp for a platform that doesn’t need compose)
I prefer a slightly different setup depending on the project. Main question: do i want compose everywhere or native iOS UI?
Case 1: Compose everywhere:
:app (you composeApp module, i just like to rename it), hosts Koin setup and entrance point to App
:core hosts all core data and domain logic with various submodules like :core:auth or :core:network. They are not actually submodules, just if you name them with : then Android Studio nicely sorts them in like
:core
:network
:auth
:data etc
:feature with submodules for each feature. For example :home or :settings
Case 2: Native UI on iOS
If i want to only share down to ViewModels, then everything from above stays the same, but each feature module has actually two modules. A shared and a ui module. So for example :feature:settings:compose (purely compose consuming ViewModels) and :feature:settings:shared (data, domain, down to ViewModel). iOS then just consumes feature:settings:shared