Closed PhilipDukhov closed 2 years ago
Hm! Incredible stuff you're showing! 😄
It's clear publicizing the current index is a useful addition. Because it's small and non-breaking I'll merge the pull request and release a patch version.
That said, keep in mind that this property may be deprecated in the future and be replaced with something akin to a .historyStackSize
and .forwardStackSize
😉
I'm trying to replicate system navigation behaviour: instead of offsetting the view on the whole width, they only offset 0.3 part of width.
How
NavigationView
+NavigationLink
animation looks like:To replicate it I've created the following transition:
The problem is that the disappearing view is always on top - it looks as expected during pop, but not during push:
The solution is to apply
zIndex
depending on the route index in the back stack - the pushing view must have a higherzIndex
than the current one.To do this, I need to have information about the current route index, which is what this PR adds.