Skip to main content
Filter by
Sorted by
Tagged with
2 votes
1 answer
59 views

I want to use NavigationStack with a custom navigation path array supporting multiple destination types. For example: enum A: Hashable { ... } enum B: Hashable { ... } NavigationStack(path: $...
RMP's user avatar
  • 5,441
0 votes
1 answer
72 views

I am trying to create a centralized router for my SwiftUI app and was hoping to take advantage of the @Environment feature for this. While this might not be the best design pattern, I am trying to ...
Shawn Frank's user avatar
  • 5,303
1 vote
1 answer
296 views

After realizing the lookup and editing limitations of the built-in, type-erased NavigationPath, I'm exploring an enum-based solution. With this approach, I can inspect and edit the path much easier ...
WorldNeedsRefactoring's user avatar
2 votes
1 answer
149 views

Can someone help me understand the behavior of 'NavigationStack.count'. I don't understand how/when it's updated. In this example, I use the count to disable back navigation. But as you can see, ...
WorldNeedsRefactoring's user avatar
0 votes
1 answer
420 views

I'm experiencing a problem using programmatic navigation using TabView and NavigationStack. I have a TabView with a $selection pointing to a NavigationPath in an environmentObject. I also have two ...
ZStacker's user avatar
0 votes
1 answer
485 views

I've stumbled upon what I think is a bug in SwiftUI, but there might be an explanation for it, which I cannot to figure out. So here's the "bug". Perhaps any of you know it. In short I found ...
Knyhuus's user avatar
  • 166
1 vote
0 answers
346 views

In a project where each view has a ViewModel object that I was using in my .navigationDestination(...). Caused an infinite loop sometimes, not every time. This code is causing infinite loop ...
2dnas's user avatar
  • 21
0 votes
0 answers
135 views

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 ...
Vaibhav Singh's user avatar
-3 votes
1 answer
393 views

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....
xj zhang's user avatar
0 votes
3 answers
2k views

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 ...
jbalt's user avatar
  • 19
0 votes
0 answers
158 views

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), ...
Silver-Elder's user avatar
1 vote
0 answers
307 views

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 ...
nickelx's user avatar
  • 11
0 votes
1 answer
842 views

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(...
amelia's user avatar
  • 111
3 votes
1 answer
797 views

I have a simple navigation router: @Observable class BaseRouter { var path = NavigationPath() var isEmpty: Bool { return path.isEmpty } func navigateBack() { path....
ItayAmza's user avatar
  • 997
2 votes
0 answers
155 views

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 ...
kelalaka's user avatar
  • 5,706
1 vote
0 answers
656 views

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 ...
san's user avatar
  • 41
1 vote
1 answer
851 views

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 ...
Arda Oğul Üçpınar's user avatar
2 votes
0 answers
2k views

I have the following view inside WindowGroup: struct SidebarSelection: View { @State var selection: Int? @State var path: [Int] = [] var body: some View { ...
Dominik's user avatar
  • 766
3 votes
1 answer
3k views

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 ...
Huntare's user avatar
  • 41
2 votes
0 answers
909 views

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 &...
Pro Girl's user avatar
  • 982
3 votes
1 answer
5k views

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 ...
Amey079's user avatar
  • 141
2 votes
1 answer
3k views

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 ...
DogDogDog's user avatar
2 votes
1 answer
2k views

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 ...
kelalaka's user avatar
  • 5,706