finds.dev← search

// the find

icerockdev/moko-mvvm

★ 1,095 · Kotlin · Apache-2.0 · updated Apr 2024

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

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.

View on GitHub → Homepage ↗

// want more like this?

We dig through GitHub every week and send a few repos picked for what you actually care about — each with an honest take like this one.

Get finds in your inbox → Search again →