-
Notifications
You must be signed in to change notification settings - Fork 2
Getting Started
sonmbol edited this page Jul 28, 2026
·
1 revision
- Swift 5.9 or later
- iOS 15, macOS 11, tvOS 14, or watchOS 7
- An exported asynchronous state source
Add the package in Xcode:
https://github.com/sonmbol/KMPObservableBridge.git
Link the product matching the application:
| Integration | Product |
|---|---|
| SKIE StateFlow | KMPObservableBridgeSKIE |
| KMP-NativeCoroutines | KMPObservableBridgeNative |
| Callback, Combine, custom | KMPObservableBridge |
Declare current-value interoperability once:
import shared
import KMPObservableBridgeSKIE
extension SkieSwiftStateFlow: @retroactive KMPValueProperty {}Select observable fields beside the feature:
@KMPObservable(
ProfileViewModel.self,
fields: \.profileState
)
extension ProfileViewModel: @retroactive KMPStaticallyObservable {}Own the ViewModel:
@KMPStateObject
private var profile = ProfileViewModel()Render a projected current value and call actions on the original model:
Text($profile.profileState.title)
Button("Retry") {
profile.retry()
}A writable Kotlin export produces a binding:
TextField("Search", text: $profile.searchText)-
KMPStateObjectowns a model for one SwiftUI identity. -
KMPObservedObjectobserves a model owned elsewhere. -
KMPEnvironmentObjectconsumes an existing projected store. - Only an owning wrapper may dispose a Kotlin model.
For a complete application, open the DailyPulse example.