Questions tagged [swiftui-navigationview]

For questions about NavigationView - a view in Apple's SwiftUI framework that presents a stack of views representing a visible path in a navigation hierarchy. When using this tag also include the more generic [swiftui] tag where possible.

Links:

583 questions
2
votes
1 answer

Normal Tap & Swipe actions while in EditMode?

I'm developing an app, one view of which has the primary goal of allowing users to reorder a List of NavigationLinks, but which I would also like to allow navigation & a few other things. I want users to be able to: Reorder by dragging on the…
lelandpaul
  • 85
  • 5
2
votes
1 answer

SwiftUI define NavigationLink destination conditionally

I’m new at SwiftUI and I’ve a doubt. I wonder if anyone can help me. I’ve a screen with two exact buttons (except for the text that they display and the view which they lead to). When they are tapped, each button leads the user to a new given…
2
votes
2 answers

How to combine searchable text in SwiftUI and opening a new View with the found text string?

I'm trying to make an app that offers a choice. Depending on the color that a user selects, a new View appears. What it will be there, depends on a text parameter. I wish to make it via search bar in SwiftUI, offering some options. A user starts…
Philip
  • 343
  • 2
  • 6
2
votes
2 answers

Transitions not working inside NavigationView

I am trying to navigate between two views without a NavigationLink. Here is the code: import SwiftUI struct NextView: View { @State var text = "" @Binding var displayView: Bool var body: some View { // 3 …
Laura Corssac
  • 1,217
  • 1
  • 13
  • 23
2
votes
2 answers

SwiftUI Remove Spacing from Top Of List in NavigationView

I have a simple SwiftUI view that uses Section's within a List: struct NewView: View { var body: some View { NavigationView { List { Section("Title") { ForEach((1...10), id: \.self) { …
David
  • 732
  • 1
  • 6
  • 15
2
votes
2 answers

NavigationStack's navigationDestination in Xcode beta unable to navigate

I am still new to SwiftUI framework I am learning with HackingWithSwift for NavigationStack. I followed all the steps just one difference is my result of code. I ran without any error just like in video however I could not navigate to my Detail…
Steven-Carrot
  • 2,368
  • 2
  • 12
  • 37
2
votes
1 answer

Body Render Issue with NavigationStack in XCode 14 Beta

In the following code, background color of the ContentView doesn't change after two seconds. struct ContentView: View { @State private var bool: Bool = false var body: some View { NavigationStack(root: { …
Vakho
  • 87
  • 7
2
votes
0 answers

SwiftUI Navigation view - navigate from one child view to another

I am using a NavigationView with tag/selection initializer that allows controlling the selected detail view both via UI and programmatically, by changing the value of the binding (model.currentItemId): @EnvironmentObject var model: Model var items:…
esp
  • 7,314
  • 6
  • 49
  • 79
2
votes
1 answer

How to show/hide column in MacOS multi-column Navigation View?

I would like to show/hide the 2nd column in a 3 column NavigationView layout on macOS. The toggle button does hide the content of the 2nd column – but I would like it to vanish completely, as if the user drags it away. Any ideas? struct…
ChrisR
  • 9,523
  • 1
  • 8
  • 26
2
votes
1 answer

SwiftUI NavigationView nests TabView auto pop

NavigationView nests TabView, I have a List, and push to the next page When the application returns to the background and returns to the active state, the push page automatically pops up. If TabView nests NavigationView, there will be no problem,…
gaohomway
  • 2,132
  • 1
  • 20
  • 37
2
votes
1 answer

SwiftUI weird List behavior when removing item from list

I've been having an issue with my list where after removing an item, it gets removed correctly, but if I toggle between two branches on the same view, my list items get this weird leading padding. Not sure how to explain it exactly, so I'm attaching…
Vedran Kopanja
  • 1,259
  • 12
  • 23
2
votes
0 answers

Is there a way to hide NavigationView inline title until user scrolls past a certain point

like the title suggests, I'm trying to collapse the navigationView title bar until the user scrolls past the first section (which I'm using as a header). Please see image. you can see the header section in this picture The reason why I can't use…
bewh
  • 21
  • 2
2
votes
1 answer

SwiftUI Edit Button not working after animation

After animating from a group conditional view, the edit button on my list doesn't work. It works fine if there's no animation, but I'm not sure why an animation would cause the edit button to not work? struct Overview: View { @State var test =…
2
votes
2 answers

SwiftUI Navigation: why is Timer.publish() in View body breaking nav stack

SwiftUI n00b here. I'm trying some very simple navigation using NavigationView and NavigationLink. In the sample below, I've isolated to a 3 level nav. The 1st level is just a link to the 2nd, the 2nd to the 3rd, and the 3rd level is a text input…
gds
  • 578
  • 1
  • 4
  • 7
2
votes
2 answers

How to use .refreshable in SwiftUI to call API and refresh list

I am attempting to add .refreshable to my SwiftUI openweathermap app, in order to pull down and refresh values being returned to the app from an API. I set up my app to allow the user to enter a city name in the text field, hit a search button, and…