I have a Screen A built in compose. I'm using it i...
# compose-ios
k
I have a Screen A built in compose. I'm using it in side swiftui and at first it is working just fine. But when I navigate from Screen A to next screen and then come back to Screen A, it's lazy column is reset, like If I had scrolled to 10th item, when I come back to A, it will be scrolled to first item. I am using swiftui's native NavigationStack for navigation. Does anyone know how can I overcome this issue? It doesn't occur on android side though.
Here are code snippets.
a
Assuming you are using the native SwiftUI navigation, I believe persistent state preservation is not supported by Compose for iOS yet. You can try using a Compose navigation library though.
k
That would require me to change whole architecture of my app.
I fixed it by moving my composable states to viewmodel, but it would be better if compose just does it out of the box.