A library that allows you to share ViewModels between Android and iOS. The latest version of the library uses Kotlin version 1.9.22. Compatibility versions for older and/or preview Kotlin versions are also available. When subclassing your Kotlin ViewModel in Swift you might experience some issues in the way those ViewModels are cleared. Since currentTimeFlow is a StateFlow we don't ever expect it to fail, which is why we are using the assertNoFailure. However, in this case you'll notice that the publisher will fail with a JobCancellationException. The problem here is that before the TimeTravelViewModel is deinited it will already be cleared. Meaning the viewModelScope is cancelled and onCleared is called. This results in the Combine publisher outliving the underlying StateFlow collection.

Features

  • Add the library to your shared Kotlin module
  • Documentation available
  • Examples available
  • Create your ViewModels
  • KMP-NativeCoroutines
  • Use the view model like you would any other Android view model

Project Samples

Project Activity

See All Activity >

Categories

Libraries

License

MIT License

Follow KMM ViewModel

KMM ViewModel Web Site

You Might Also Like
RMM Software | Remote Monitoring Platform and Tools Icon
RMM Software | Remote Monitoring Platform and Tools

Best-in-class automation, scalability, and single-pane IT management.

Don’t settle when it comes to managing your clients’ IT infrastructure. Exceed their expectations with ConnectWise RMM, our MSP RMM software that provides proactive tools and NOC services—regardless of device environment. With the number of new vulnerabilities rising each year, smart patching procedures have never been more important. We automatically test and deploy patches when they are viable and restrict patches that are harmful. Get better protection for clients while you spend less time managing endpoints and more time growing your business. It’s tough to locate, afford, and retain quality talent. In fact, 81% of IT leaders say it’s hard to find the recruits they need. Add ConnectWise RMM, NOC services and get the expertise and problem resolution you need to become the advisor your clients demand—without adding headcount.
Rate This Project
Login To Rate This Project

User Reviews

Be the first to post a review of KMM ViewModel!

Additional Project Details

Operating Systems

Android, Apple iPhone

Programming Language

Swift

Related Categories

Swift Libraries

Registered

2024-02-27