finds.dev

icerockdev/moko-mvvm

Model-View-ViewModel architecture components for mobile (android & ios) Kotlin Multiplatform development

View on GitHubHomepage ↗

★ 1,095KotlinApache-2.0updated Apr 2024

// the take

moko-mvvm brings Android's Architecture Components ViewModel and LiveData patterns to Kotlin Multiplatform, letting you write shared UI logic that works on both Android and iOS. On Android it wraps androidx.lifecycle.ViewModel directly, so you get real lifecycle awareness; on iOS it approximates it. It's aimed at KMM teams who want a single ViewModel layer without rewriting platform-specific state management.

The Android side is not a reimplementation — it delegates to androidx.lifecycle.ViewModel, so you get all the real behavior (process death survival, lifecycle scoping) for free. EventsDispatcher solves a real problem: one-shot events like navigation that LiveData/StateFlow handle badly, with buffering when the listener isn't attached. The module split (core, livedata, flow, compose, databinding) is sensible — you only pull in what you need. The CFlow/CStateFlow wrappers for iOS interop handle the callback-based consumption pattern Swift needs without leaking coroutine internals.

Last commit was April 2024 and the KMM ecosystem has moved fast — Compose Multiplatform with @Stable ViewModels is now the idiomatic path, making LiveData-based bindings feel dated for new projects. iOS lifecycle management is manual: you call viewModel.onCleared() in didMove(toParentViewController:) yourself, which is easy to forget and won't be caught by the compiler. The LiveData operator set (map, mergeWith, all) is a bespoke API that Kotlin Flow already covers better; you're learning two reactive systems if you use both. Documentation is sparse beyond the README samples — no API reference and the KSwift recommendation adds another dependency just to get usable Swift extensions.

We read the README, the directory tree and a key source file in June 2026. Nobody pays to be listed. How we judge →

// at a glance

Stars
1,095
Forks
97
Language
Kotlin
License
Apache-2.0
Last commit
18 Apr 2024

// nearby

If moko-mvvm isn't quite it.

All repos →