Guidance for how to persist navigation state between launches using swift-sharing #3758
Unanswered
cameronmcefee
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hello!
I'd like to be able to persist the user's navigation
StackState
so that when they launch the app they start where they left off. I'd hoped it'd be as easy as something like:@ObservableState public struct State: Equatable { + @Shared(.appStorage("navigationPath")) var path = StackState<Path.State>() public init() {} }
But this comes with a lot of compiler warnings. I've been digging through docs and video transcripts but haven't found anything like this. Do you have guidance for how to do this? Is it possible to do it this simply, or do I need some kind of second property where I track it and restore it in an onAppear manually?
Beta Was this translation helpful? Give feedback.
All reactions