KMPObservableBridge 1.0.1 — Kotlin State. Native SwiftUI.
KMPObservableBridge lets SwiftUI use real Kotlin Multiplatform ViewModels directly—without a duplicate Swift adapter ViewModel.
@KMPStateObject
private var profile = ProfileViewModel()Highlights
- Automatic lazy SKIE
StateFlowdiscovery with compatibility diagnostics and cached runtime detection. - Direct KMP-NativeCoroutines
NativeFlowobservation. - Explicit typed
state:andstates:key paths for deterministic integration. - SwiftUI-style owning, observed, environment, and child ViewModel wrappers.
- Main-actor invalidation, update coalescing, rebinding, cancellation, disposal, and stale-emission suppression.
- No required Kotlin superclass, annotation, compiler plugin, code generator, or third-party runtime dependency in the Swift package.
Installation
Add https://github.com/sonmbol/KMPObservableBridge as a Swift Package dependency and import KMPObservableBridge.
Compatibility
- Swift 5.9+
- iOS 14+, macOS 11+, tvOS 14+, watchOS 7+
- SKIE and KMP-NativeCoroutines integration demonstrated by the included DailyPulse application
Please open a Discussion if you want help integrating one ViewModel or want to share your Kotlin, SKIE/KMP-NativeCoroutines, Swift, and Xcode version combination.
See the README, integration guide, and DailyPulse example for complete usage.