Hi, I need to check when my app is destroyed (tota...
# compose-ios
a
Hi, I need to check when my app is destroyed (totally closed) in iOS. I look at the docs and I found the mapping between Android and iOS around LifeCycle. But viewControllerDidLeaveWindowHierarchy is actually not available in the iOS docs and ON_DESTROY isn't called in an iOS app. Is this a bug or is it intended?
a
On this page there isn't an event viewControllerDidLeaveWindowHierarchy. Is it possible that there is something wrong in the docs? https://www.jetbrains.com/help/kotlin-multiplatform-dev/compose-lifecycle.html#mapping-android-lifecycle-to-other-platforms
a
iOS Application is not equal to Compose container. Currently we're not considering "Application will terminate" event as a reason to destroy compose container and hence, notify the the listener. Please create an issue in our YouTrack. As compose controllers may be created and destroyed multiple times inside the application, it's not always safe to rely on the ON_DESTROY event anyway. Please use the aforementioned notification center's event.
j
@Andrei Salavei Should Lifecycle not be used in Multiplatform projects? What’s the use-case for moving this component to KMP if we should directly use/rely on system APIs?