Questions tagged [swiftui-navigationstack]

For questions about SwiftUI's NavigationStack, a view that displays a root view and enables you to present additional views over the root view.

198 questions
1
vote
1 answer

How to use NavigationLink outside of NavigationStack?

I have a safe area inset view that is placed on my NavigationStack so that acts as a bottom bar across all pushed views. However, in the safe area inset view, there are button which I'd like to push views onto the stack. The NavigationLink is greyed…
TruMan1
  • 33,665
  • 59
  • 184
  • 335
1
vote
1 answer

NavigationItem in nested NavigationStack is below NavigationBar

I'm making an app where you create acronyms and their meaning with SwiftUI The flow of the app consists of having a List of Acronym, when tapping on any element it takes you to the detailView for that particular acronym, and there you can tap on an…
Frakcool
  • 10,915
  • 9
  • 50
  • 89
1
vote
1 answer

Bug with NavigationLink and @Binding properties causing unintended Interactions in the app

I've encountered a bug in SwiftUI that could cause unintended interaction with the app without the user's knowledge. Description The problem seems to be related to using @Binding properties on the View structs when used in conjunction with…
Hollycene
  • 287
  • 1
  • 2
  • 12
1
vote
1 answer

NavigationStack inside TabView inside NavigationStack throws

I'm trying to migrate a coordinator pattern using UINavigationController into the new NavigationStack. The navigation flow is quite complex, but I've made a simple project to simplify it to this: NavigationStack -> MainScreen -> TabView …
Marco Scabbiolo
  • 7,203
  • 3
  • 38
  • 46
1
vote
1 answer

SwiftUI - NavigationLink and NavigationStack is not working with a button for iOS 16

I am making an app where I need to navigate to the home page when the user clicks on the Login button and when the Login button is clicked, the navigation link code is not working and shows a warning as Result of 'NavigationLink'…
1
vote
1 answer

NavigationStack failing to show the correct view hierarchy after pushing value from other tab

I have a bug in my application so I decided to create a self-contained example for the sake of being simple, which reproduces the problem. I have a content view with two tabs: contacts and users: struct ContentView: View { @StateObject var…
Ramy Al Zuhouri
  • 21,580
  • 26
  • 105
  • 187
1
vote
1 answer

Unwanted white space on Sheet

I have a basic tabview with 2 tabs. Tab 2 has a button to a modal sheet with a Page Style tabview imbedded in a Navigation Stack and added toolbar. When adding the Navigation Stack I get an unwanted white space at the bottom of the sheet view…
1
vote
1 answer

SwiftUI Half-swipe back from navigation causes error

I noticed issue in SwiftUI when using NavigationStack Once I swipe-back on a half and revert it -> it stops working Also I attached sample code if you want to try it import SwiftUI struct ContentView: View { var body: some View { …
1
vote
1 answer

I cannot navigate deeper into the views in Swiftui

I have three views in my project - ContentView, SecondView, ThirdView I want to navigate from contentView to secondView and secondView to thirdView. ContentView :- import SwiftUI struct ContentView: View { @State private var path =…
1
vote
0 answers

How to keep SwiftUI Navigation Swipe Back gesture, when NavigationStack has a padding?

I'm using SwiftUI's NavigationStack. When NavigationStack has a .padding(), the swipe back gesture no longer works. My best guess is that the gesture has to be triggered from the edge of the screen. And with padding, it cannot…
Legolas Wang
  • 1,951
  • 1
  • 13
  • 26
1
vote
0 answers

NavigationStack: Destination not updated on path removal during animation

In my application I am using a custom navigation bar which, besides other functionality, allows the user to navigate back. I am using a NavigationStack with an array with enums as path. On navigating back I simply remove the last element of the…
J. Cervus
  • 185
  • 10
1
vote
0 answers

Is there a way to return the name of a Navigation Path in SwiftUI 4?

I'm trying to implement Pop to Root functionality in an app with a Tab View. Here's my class where I define my Navigation Paths. Each path is assigned to a Tab. Tabs share child views that have a button that calls the reset() function. Right now…
M Alamin
  • 307
  • 2
  • 10
1
vote
1 answer

Why is iOS16's NavigationLink disabled?

I am currently trying to use iOS16's NavigationLink to show detail views for my list items, but for some reason the items seem to be disabled - does anyone know why this is happening? NavigationLink(value: example) { ListRowView(title:…
1
vote
1 answer

NavigationStack pushing new View issue with @Published

Weird issue using new NavigationStack. When trying to push the DrinkView for the second time, it's pushed twice and the OrderFood gets view removed from the navigation. The reason is @Published var openDrinks in the View Model. Is there is any way…
1
vote
1 answer

Found a strange behaviour of @State when combined to the new Navigation Stack - Is it a bug or am I doing it wrong?

I have transitioned my swiftui app to the new NavigationStack programmatically managed using NavigationStack(path: $visibilityStack). While doing so, I found an unexpected behaviour of @State that makes me think the view is not dismissed…