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
0
votes
0 answers
SwiftUI List searchable animation issue
I have just started learning SwiftUI and have created a basic View as follows:
import SwiftUI
struct ContentView: View {
@State var searchText = ""
@State var items = 0...5
var body: some View {
NavigationStack {
…
0
votes
0 answers
how to hide Tabview when using ToolbarItem, preserving ToolbarItem by disappearing
I have two views embedded in a TabView and a third view activated by a ToolbarItem in a navigationStack.
problem 1)
When I tap on plus button I navigate to my addView, but I still can see the tabs at the bottom.
problem 2)
after many test I found…

biggreentree
- 1,633
- 3
- 20
- 35
0
votes
2 answers
NavigationStack is breaking binding
I recently tried to migrate from SwiftUI NavigationView to NavigationStack, but experienced some problems with bindings. If the view stack has changes, my bindings seem to convert into some sort of local state instead of bindings.
I was able to…

Dunderklaepp
- 34
- 5
0
votes
0 answers
How to navigate back programatically using nested navigationDestination in SwiftUI
I'm trying to implement programatic nested navigation using NavigationStack and navigationDestination(isPresented:). But I can't figure out why I can't navigate back to A (button Go back to A is not working - nothing happens when I press it). Does…

Ella Gogo
- 1,051
- 1
- 11
- 17
0
votes
2 answers
NavigationLink doesn't work when View is embedded in a modal sheet
Weird problem.
I have a view called SecondView which has a NavigationLink like so:
struct SecondView: View {
var body: some View {
NavigationStack {
List {
Section {
EmptyView()
…

helloimbrando
- 307
- 2
- 13
0
votes
0 answers
NavigationStack (Custom Package) Animation Mismatch
I've created a wrapper around navigation stack API with replace root & push and remove until features.
There is one bug that I couldn't overcome for a while. There is one issue that mismatches pop and pushes animations after certain navigation…

Mehmet Karanlık
- 237
- 1
- 10
0
votes
1 answer
Confirm Stripe payment in SwiftUI (iOS 16)
I am using Stripe API to accept card payment in SwiftUI.
I managed to make successful payment using STPPaymentCardTextField wrapped in UIViewRepresentable and confirm it using the provided sheet modifier .paymentConfirmationSheet(....).
The problem…

MatuskaApp
- 1
- 1
0
votes
0 answers
SwiftUI Navigation Stacks for different levels with in the app
I have this TabView based SwiftUI app and each tab has its own navigation stack which works as expected and there are no issues because all my 4 tabs have 4 separate independent navigation stacks.
However, in many cases, on those navigations, I want…

The iOS Guy
- 1
- 1
0
votes
0 answers
SwiftUI NavigationStack .searchable .onSubmit
I have MainView and where I have NavigationStack. I need to make it so that when I press the Search button, another view is shown and when I press the Cancel button, it is hidden again.
var body: some View {
NavigationStack {
…

Aleš Slabý
- 23
- 4
0
votes
0 answers
Unable to RE-navigate through SwiftUI app
I’m writing a workout app for Apple Watch but am running into issues with navigation. I have a version which includes the behaviour I’m looking for but am trying to simplify the navigation through the app which is leading to issues.
The “working”…

bskies
- 1
- 2
0
votes
1 answer
Some NavigationLink are inaccessible
My SwiftUI TVOS app has two sets of NavigationLink. When both sets are present (not commented out), only one set is accessible to tap on. If I comment out one or the other set, the remaining NavigationLink is accessible to tap on and functions…

I'm Just a Bill
- 1
- 2
0
votes
3 answers
iOS 16 NavigationLinks in nested Lists unclickable
I am running xCode 14.2 on iOS 16.2 simulator and iOS 16.1.2 device.
I have, in my app, NavigationLinks in sublists that are implemented as nested Lists. After updating my xCode, suddenly the NavigationLinks have become unclickable. It looks like…

skywalkerdude
- 117
- 1
- 8
0
votes
1 answer
NavigationStack inside TabView inside NavigationStack does not work
I want to have a root NavigationStack that lets the user navigate around a SwiftUI app, including to a TabView with tabs that have their own navigation stack. Unfortunately, this seems to not work at all (xcode 14.2, iOS 16).
The following example…

Greg Ennis
- 14,917
- 2
- 69
- 74
0
votes
0 answers
Edit List in a NavigationStack
I want to edit my List, which is in a NavigationStack. The Items in the List are NavigationLinks.
I saw how to remove Items from a List, but not how, when the List is in a NavigationStack.
import SwiftUI
struct Title: Identifiable, Hashable {
…

c0ntrol3F_
- 5
- 3
0
votes
0 answers
NavigationStack missing root controller from path
i am building a historical navigation (backwards, forwards) for a macOS app
It works mostly fine, but my implementation relies on the path, which however doesn't contain the root (when the sidebar is selected, and [] is assigned to path)
how to get…

Peter Lapisu
- 19,915
- 16
- 123
- 179