Questions tagged [swiftui-navigationpath]
11 questions
2
votes
1 answer
A complex Navigation with NavigationPath in SwiftUI
The usual flow is the stack. Push views and pop views. My requirements is a bit complex and I did not find a way to do it in IOS 16.
Let say we have a
Cover page
Contents page
Details page
Now, the requirements;
Cover page can push the Details…

kelalaka
- 5,064
- 5
- 27
- 44
1
vote
0 answers
SwiftUI navigation router issues
I have a simple navigation router:
@Observable class BaseRouter {
var path = NavigationPath()
var isEmpty: Bool {
return path.isEmpty
}
func navigateBack() {
path.removeLast()
}
func popToRoot() {
…

ItayAmza
- 819
- 9
- 21
1
vote
1 answer
(2023) NavigationStack and NavigationDestination, using NavigationPath Correctly
I am trying to accomplish a relatively simple task. I want to navigate from a root view -> intermediate view that captures input -> final view that displays input -> back to root view.
The solution I came up with uses the new NavigationPath and…

Huntare
- 21
- 3
1
vote
0 answers
SwiftUI - NavigationStack: Why my NavigationPath() is printing the wrong path.count?
I have the following basic utilization of NavigationStack with SwiftUI for iOS 16, Xcode.
The issues I am facing is that when I click back and printing the count, the root count is wrong and shows as "1" instead of always showing as "0".
Why and how…

Pro Girl
- 762
- 7
- 21
1
vote
1 answer
SwiftUI NavigationStack Navigation
I'm trying to use NavigationStack for Navigation for my SwiftUI Project. I have 4 Screens in total. The Main Page of my App has Login and Sign up Buttons. If the user signs in successfully the App takes the user to the Home Page where the User can…

Amey079
- 131
- 7
1
vote
1 answer
SwiftUI - NavigationStack not working as expected
For some reason, my NavigationStack is bugging out when clicking through. I have changed NavigationView -> NavigationStack by it seems to be more complicated than anticipated and would greatly appreciate the help.
In one of my Views the…

DogDogDog
- 13
- 2
0
votes
0 answers
SwiftUI, prevent the subview to inherit parent's animation
I've been playing with the NavigationPath for some time. I first figured that when a view is inserted into the path (full code is on this answer), the inserted page doesn't have standard navigation transition animation so, I've decided to force one…

kelalaka
- 5,064
- 5
- 27
- 44
0
votes
0 answers
NavigationStack's path are being emptied when NavigationStack disappears
In the executable code below I try to implement the main navigation view for an (iPadOS) app. The expected behaviour is as follows:
A NavigationSplitView is used to present a sidebar to the user containing the main categories of the app
If a user…

san
- 31
- 6
0
votes
1 answer
SwiftUI | Strange behaviour after appending paths to Routerpath onAppear
I want to completely rework how NavigationBar's look and rework back button as I like and have my own router In my app.
I created this sample project to understand how NavigationStack and NavigationPath works before starting my project (From this…

Arda Oğul Üçpınar
- 881
- 1
- 14
- 38
0
votes
0 answers
Path of NavigationStack inside NavigationSplitView emptied on change
I have the following view inside WindowGroup:
struct SidebarSelection: View {
@State var selection: Int?
@State var path: [Int] = []
var body: some View {
NavigationSplitView {
List(1...20, id: \.self,…

Dominik
- 706
- 7
- 22
-1
votes
0 answers
NavigationPath and navigationDestination with custom back button fails on iOS 17 BETA
NOTE: I have reported it to apple. However, the question is, "Is there a workaround/fix for this?" My concern is this will be missed by apple and I want to have a workaround ready if Apple does NOT fix it for their final release.
Using the new…

Peter Suwara
- 781
- 10
- 16