Questions tagged [swiftui-navigationpath]
The swiftui-navigationpath tag has no usage guidance.
16
questions
3
votes
1
answer
2k
views
(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 ...
3
votes
1
answer
282
views
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....
2
votes
1
answer
3k
views
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 ...
2
votes
1
answer
1k
views
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 ...
2
votes
0
answers
645
views
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 &...
2
votes
1
answer
890
views
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 ...
1
vote
0
answers
74
views
How to properly manage view focus while pushing multiple views to NavigationStack path in SwiftUI iOS 17+
I'm trying to save the state of my NavigationPath for my NavigationStack in SwiftUI by pushing all the views to the stack at once. That way if the user taps the Back button, they will still see the ...
1
vote
0
answers
97
views
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 ...
1
vote
0
answers
876
views
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 {
...
0
votes
0
answers
47
views
Is it wise to have a single state as an environment object for the whole SwiftUI app?
I've been looking at different ways to build in deeplinking capabilities for a SwiftUI app using NavigationSatck. Some articles suggest having the navigation state injected as an environment object ...
0
votes
2
answers
89
views
How to get the last two items from the stack of a NavigationPath() object
I am facing a challenge in SwiftUI and would appreciate some guidance. In my code, I'm working with a NavigationPath() object and need to obtain the last two items from the stack. Specifically, this ...
0
votes
0
answers
56
views
SwiftUI List Causes "No `navigationDestination(for: <Hashable>.self) { … }` was found among the views on the path" Error
I've been trying to understand for the past several weeks why my app has been crashing at times when I save my app's NavigationPath.CodableRepresentation to core data (as a Binary Data type), ...
0
votes
1
answer
246
views
How to figure out what navigationpath you came from to append to it?
I have several navigation paths using the same enum so that I'm able to clear that path and bring the user back to the main tab view for that item. This works great when I am using navigationLink(...
0
votes
0
answers
524
views
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 ...
0
votes
1
answer
505
views
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 ...
-3
votes
1
answer
70
views
NavigationPath(_items: SwiftUI.NavigationPath.(unknown context at $7ff84b690a28) Representation.eager([SwiftUI.(unknown context at $7ff84b6907f0).C
I tried to use navigationstack, and it works. but couldn't print the path, and with the message: " NavigationPath(_items: SwiftUI.NavigationPath.(unknown context at $7ff84b690a28).Representation....