ade
01/24/2025, 9:01 AMFrançois
01/24/2025, 9:02 AMade
01/24/2025, 9:04 AMade
01/24/2025, 9:18 AMade
01/24/2025, 9:21 AMFrançois
01/24/2025, 9:23 AMdeinit/onCleared
of the ViewModel.ade
01/24/2025, 9:28 AMFrançois
01/24/2025, 9:32 AMade
01/24/2025, 9:32 AMFrançois
01/24/2025, 9:35 AMade
01/24/2025, 9:35 AMFrançois
01/24/2025, 9:38 AMFrançois
01/24/2025, 9:40 AMonCleared()
method, but some stuff is missing like callback set on init.François
01/24/2025, 9:41 AMViewModelStore
on the swift side and synch with the lifecycle of the SwiftUI View.John O'Reilly
01/24/2025, 9:42 AMJohn O'Reilly
01/24/2025, 9:42 AMFrançois
01/24/2025, 9:43 AMFrançois
01/24/2025, 9:43 AMJohn O'Reilly
01/24/2025, 9:46 AMade
01/24/2025, 9:48 AMFrançois
01/24/2025, 9:48 AMade
01/24/2025, 9:49 AMFrançois
01/24/2025, 9:53 AMexport
the class to the ObjC header, so it will be accessible in your iOS app.François
01/24/2025, 10:01 AMade
01/24/2025, 10:03 AMFrançois
01/24/2025, 10:05 AMandroidx.lifecycle:lifecycle-viewmodel
?ade
01/24/2025, 10:06 AMFrançois
01/24/2025, 10:07 AMandroidx.lifecycle:lifecycle-viewmodel
is officially KMP since last year and not considered as experimentalade
01/24/2025, 10:08 AMFrançois
01/24/2025, 10:10 AMorg.jetbrains.androidx.lifecycle:lifecycle-viewmodel-compose
the Android/KMP one is androidx.lifecycle:lifecycle-viewmodel
ade
01/24/2025, 10:11 AMFrançois
01/24/2025, 10:16 AMI guess you’re thinking of the way the ViewModelStore calls onCleared to clean up the ViewModel?Yes and other properties like the viemodelscope, callback ... We simply reproduce what it’s done on Android when using the ViewModel + Navigation. The difference here : 1 ViewModelStore = 1 SwiftUI screen.
ade
01/24/2025, 10:33 AMFrançois
01/24/2025, 10:38 AM