Replies: 1 comment
-
|
See NavigatorDemoApp.swift in 0.9.18. |
Beta Was this translation helpful? Give feedback.
0 replies
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.
-
In my AppRootType, the app determines whether to use a split or tabbed configuration. Specifically, if the device is an iPad, a splitView is set up; otherwise, a different configuration is applied.
Now, I'm considering allowing iPad users to choose between a split view and a floating view (similar to the App Store on iPad). The idea is to evaluate an enum with a Boolean-associated value inside an if .isPad(Bool) block. If .isPad(true), the split view is displayed; otherwise, if .isPad(false), the floating bar view is shown.
Users can select their preferred layout in the app settings, and upon selection, the navigation stack should reset (flush) to reflect the new configuration.
To implement this, I modified the conditional logic to check if the device is an iPad and then evaluate the associated value. Based on this check, the app switches to the appropriate layout by determining whether to use a split or floating interface. You can picture it something like, navigator.send([dismissAll, AppRootType.isPad(Bool)])
The issue I'm facing is that Navigator always treats the new configuration as a new view on top of the root view. However, what I actually want is to reset the navigation stack completely—rolling back to the very beginning and restarting with the new view and selected configuration.
Does Navigator support this kind of mess I am trying to achieve lol?
Beta Was this translation helpful? Give feedback.
All reactions