Replies: 2 comments 4 replies
-
|
Is there a reason you're simply not using NavigationSplitView? But yeah, I've been playing with ways to expose more of the navigation path. Umm... if Navigator exposed it (It's internal at the moment, you could encode it to data and then decode to set the other path. (Presumes all destinations are Codable, of course.) |
Beta Was this translation helpful? Give feedback.
-
|
Also interested in this since I in some parts of my app, I need to remove some destinations from the middle of the stack. I currently do it by assigning a new array of destinations to Or is there another way to do it with Navigator? |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I'm working on a project where I need to keep two separate navigation stacks in sync; the reason is that the stack hierarchy changes depending on the horizontal size class (in regular I show a single split view whereas in compact I show two separate views on the stack, a list and a detail view).
What do you think of exposing more details around the navigation path and publishing when changes happen to the path? This would enable a large degree of flexibility for manipulating the path as needed.
I believe this would require using something other than
Swift.NavigationPathas thepathprovided to the navigation stack. In a rudimentary attempt to do this myself, I swapped the type of thepathvariable inNavigatorfromNavigationPathto[AnyNavigationDestination]and I ran into lots of trouble. In particular the type erasure broke all sorts of functionality, so I understand it's nontrivial.If this approach seems too odd to be appropriate for the library, do you have any possible ideas for how I might achieve this changing of the navigation stack based on horizontal size class?
Beta Was this translation helpful? Give feedback.
All reactions