Gabriel

Results 157 comments of Gabriel

This won't work because it Navigator is only present inside the `Navigator() {}` declaration.

You can create a custom BackPressureHandler for desktop. ```kotlin object BackPressureHandler { private val callbacks = mutableSetOf() fun register(onBackPress: OnBackPress) { callbacks += onBackPress } fun unregister(onBackPress: OnBackPress) { callbacks.remove(onBackPress)...

Can you share how you are displaying the Compose content? I mean, I want the main app Screen that you are adding the ComposeUiViewController to see if I can reproduce...

I have being validating your sample, thanks for sharing btw. It seems that Compose iOS complete destroy the composition when you do a `presentViewController`. Voyager relies 100% in the `rememberSaveable`...

I have open a issue in Compose Multiplatform with your snippet. https://github.com/JetBrains/compose-multiplatform/issues/4112

I have found a workaround for now. ```kotlin object ComposeStateRestoration { var valuesToBeRestored: MutableState = mutableStateOf(emptyMap()) } fun MainViewController() = ComposeUIViewController { CompositionLocalProvider( LocalSaveableStateRegistry provides SaveableStateRegistry( ComposeStateRestoration.valuesToBeRestored.value, canBeSaved = {...

And here is a patch validating the solution on Voyager Multiplatform sample. ```patch diff --git a/samples/multiplatform/src/iosMain/kotlin/MainViewController.kt b/samples/multiplatform/src/iosMain/kotlin/MainViewController.kt index dee0b39..48d1463 100644 --- a/samples/multiplatform/src/iosMain/kotlin/MainViewController.kt +++ b/samples/multiplatform/src/iosMain/kotlin/MainViewController.kt @@ -1,4 +1,156 @@ +import androidx.compose.foundation.background...

This is not a Voyager issue, this workaround will do the work. I will keep this issue open until we have proper documentation.

I think it should be fixed on Compose KMP [1.6.10-beta01](https://github.com/JetBrains/compose-multiplatform/releases/tag/v1.6.10-beta01)

@L-Andrade Can you try something like this if you haven't? ```kotlin class MainActivity : ComponentActivity() { override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) setContent { VoyagerDemoTheme { CompositionLocalProvider( LocalNavigatorScreenLifecycleProvider provides EmptyNavigatorScreenLifecycleProvider...