For questions about SwiftUI's NavigationStack
, a view that displays a root view and enables you to present additional views over the root view.
Questions tagged [swiftui-navigationstack]
198 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
2
votes
0 answers
NavigationStack inside paged TabView is broken
I want to have horizontal paging with navigation bars on each page. Going with TabView, there is an issue in combination with page style when nesting NavigationStack. Let me show you an example.
The following code works but uses tabs.
var body: some…

Borut Tomazin
- 8,041
- 11
- 78
- 91
2
votes
1 answer
New NavigationStack in SwiftUI transition, how to change from the default slide to custom or appear?
I have NavigationStack with its own navigation links, for iOS16 development.
How to change the default slide transition to appear or a custom transition?
Also do you apply the transition on the NavigationStack or on the NavigationLink?
This is my…

Pro Girl
- 762
- 7
- 21
2
votes
1 answer
How to go to different Views with with navigationDestination modifier for the NavigationStack for iOS 16?
I am trying to go to 2 differnt views from the NavigationStack by usgin differnt navigationDestination modifier, however I am always getting directed to the same destination. How to fix it?
Here is my code:
import SwiftUI
struct NavTest: View {
…

Pro Girl
- 762
- 7
- 21
2
votes
1 answer
SWIFTUI - IOS 16 VideoPlayer AVplayer Autoplay stops working when doing any $Binding. How to fix?
I am using SWIFTUI for iOS 16 project, I have 2 view:
ContentView (It has inside a regular NavigationStack with path binding)
TeaserView (It a full screen video that I want it to autoplay the moment the view is called)
Everything works as it…

Pro Girl
- 762
- 7
- 21
2
votes
1 answer
Why NavigationStack's navigationDestination is not called when part of VStack?
NavigationStack .navigationDestination() is not called if the navigation stack is a child of another container.
The navigation happens visually but it only pushes to the stack a view with the typical yellow warning icon in the middle. If I make the…

Fawkes
- 3,831
- 3
- 22
- 37
2
votes
1 answer
SwiftUI - NavigationStack opening same view multiple times
I am fairly new to iOS development and have been experimenting with SwiftUI for a bit.
I am stuck for a while with list navigation and can't seem to fix the issue in any way.
Here is what I've done:
struct BlogNavigationGraph: View {
@State…

Danail Alexiev
- 7,624
- 3
- 20
- 28
2
votes
1 answer
NavigationStack Searchable .focused
I need to configure when the user clicks in the Search box to fulfill the condition (display another View). Once he clicks Cancel to display the original view (which can already be tested via .onChange(of: searchText) { value in if (!value.isEmpty)…

Aleš Slabý
- 23
- 4
2
votes
1 answer
SearchBar leads to warning. SwiftUI
I noticed that Xcode shows warning when a view has list with SearchBar and swipe down action leads to it.
The warning message: [Assert] What changed the navigation bar bounds size to something unexpected during the animation if it wasn't a…

Alexander Khitev
- 6,417
- 13
- 59
- 115
2
votes
0 answers
NavigationLink In NavigationStack is disabled
I wrote test code for NavigationStack. The behavior of the code is a two-step transition(ContentView -> SubsubTestView -> DetailView).
But I got an error when I have selected a name in SubsubTestView.
A NavigationLink is presenting a value of type…

tbt
- 399
- 3
- 16
2
votes
0 answers
Removing more than one view from NavigationStack is not animated
I noticed that removing more than 1 view from a NavigationStack (using .removeLast(k) on its NavigationPath, where k > 1) is not animated at all. I was expecting to see the previous view sliding right, revealing to root view.. but what I get instead…

Paul Mielle
- 65
- 5
2
votes
2 answers
SwiftUI: searchable weird push animation?
I have the following code:
enum ContentViewRouter {
case details
}
struct ContentView: View {
var body: some View {
NavigationStack {
ZStack {
NavigationLink(value:…

zumzum
- 17,984
- 26
- 111
- 172
2
votes
0 answers
navigationDestination(isPresented) with a path in swiftui 4
Im trying to pop back to a specific view point or the root view with navigationDestination(isPresented) being used to push views.
Here is a simpler version of the code I am working with
import SwiftUI
struct View1: View {
@State var…

EmeraldLockdown
- 57
- 4
2
votes
1 answer
SwiftUI Navigation Stack with Routes
I'm trying to create navigation for my app using Navigation Stack and routing.
My code is functioning and navigating to views, the problem I'm having is that the view is getting called several times from within a switch statement, I have placed the…

steve lang
- 21
- 2
2
votes
1 answer
Why are objects still in memory after emptying NavigationStack path?
I'm trying to implement a Coordinator for managing a flow. The state is stored inside the CoordinatorStore. There are 2 @Published properties for managing the flow. The screen property controls which View is currently shown and path controls the…

hydro1337x
- 95
- 5