Add z index to the views being pushed and popped so that the views appear on top of each other. #42
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hi @matteopuc! I really love the work you did on the NavigationStackView and I think it's a really grate alternative for the SwiftUI default NavigationView.
I started using it and wanted to create a custom transition, one that mimics the iOS's push and pop transition where the view being pushed goes on top of the other. Like this:
https://i.stack.imgur.com/Lmb7G.gif
Unfortunately in the current implementation the currentView will always appear on top (even when popping) and I got something like this:
push_pop_demo.mov
To get the effect I wanted I added a
zIndex
to the pushed and popped views.Screen.Recording.2021-01-29.at.15.58.00.mov
I am writing this pull request as an idea, please take a look at it and disregard it if you think it's not in the direction you want to take your project 😄 .