Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stack Reset / Jump to a completely different view #69

Open
richardtop opened this issue Oct 8, 2021 · 2 comments
Open

Stack Reset / Jump to a completely different view #69

richardtop opened this issue Oct 8, 2021 · 2 comments

Comments

@richardtop
Copy link

Thanks for this project!
I'm interested in the following functionality:
Consider, we have a list of views in the stack: [Z, A, B, C]
I'd like to reset stack completely to have new view hierarchy as [Z, X] by e.g. pressing a button in the view C.
Is this possible as of right now?

@davidscheutz
Copy link

Hey @richardtop, there are technically two solutions to achieve that:
Remove A, B and C from the stack and push X or replace the existing stack with [Z, X].
The easier and probably more elegant solution (at least from a UI perspective) is to simply set the new stack animated.

I created a simple SwiftUI library that supports exactly that scenario. You can find the project there: https://github.com/davidscheutz/swiftui-infinite-navigation/tree/1.0.0

Hope that is helpful ✌️

@richardtop
Copy link
Author

Thanks, I'll take a look!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants