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
1
vote
2 answers

Unable to activate NavigationLink programmatically, in a List ForEach

In a simple test project at Github I display a List of NavigationLink items: The file GamesViewModel.swift simulates a list of numerical game ids, coming via Websockets in my real app: class GamesViewModel: ObservableObject /*, WebSocketDelegate */…
1
vote
1 answer

Using TextField hides the ScrollView beneath it in VStack

This view hold a list of pdf names which when tapped open webviews of pdf links. The view has a search bar above the list which when tapped causes the scrollview to disappear. struct AllPdfListView: View { @Environment(\.presentationMode) var…
1
vote
1 answer

Button click go another page in swiftui

I have two view one is LoginView. Another is WelcomeView. I want to go from LoginView to WelcomeView onclick button from LoginView. Here is my code.. LoginView struct LoginView: View { var body: some View { VStack{ Button(action: { …
Enamul Haque
  • 4,789
  • 1
  • 37
  • 50
1
vote
1 answer

SwiftUI NavigationItem dynamic data sending incorrect parameter

I have what I thought was a simple task, but it appears otherwise. As part of my code, I am simply displaying some circles and when the user clicks on one, it will navigate to a new view depending on which circle was pressed. If I hard code the…
grayson
  • 945
  • 1
  • 11
  • 28
1
vote
0 answers

SwiftUI - View pop backs on button click automatically

I am working on a shopping app with firestore as a backend, where users add products to the cart.(Shop -> Product Category -> Product -> Add to cart). There is some weird behavior when the user clicks on the add to cart button. For the first time…
1
vote
1 answer

SwiftUI Strange Animation Transitioning via NavigationLink to a new View?

I'm experiencing a strange animation behavior when transitioning from any item in the List of InsightsHomeView to InsightsCard Any idea what could cause this or how to fix? //Navigating from this view: struct InsightsHomeView: View { var…
GarySabo
  • 5,806
  • 5
  • 49
  • 124
1
vote
1 answer

Three Column Navigation View does not update until you click to show the sidebar on iPad

Given this View: struct ContentView: View { @State var link1Active: Bool = false var body: some View { NavigationView { List { NavigationLink(destination: Text("Link1 Destination"), isActive: $link1Active) { …
Jozef Dransfield
  • 524
  • 4
  • 11
1
vote
0 answers

SwiftUI problem with keyboards, NavigationViews and Popovers in iOS 15

On iOS 15, I am encountering problems with the focus of the keyboard, navigation views and popovers. I have tried to reproduce it in the following code, but it behaves slightly different to the app. Here, it loses focus with each character. In the…
cire1776
  • 113
  • 1
  • 8
1
vote
1 answer

SwiftUI Navigation. View pops immediately after being pushed. How to fix?

I found a strange bug. In one moment view started popping immediately after being pushed. I had been commenting the code piece by piece until reduced it to a minimal reproducible example. Here is the code: struct Destination : View { private let…
Semyon Tikhonenko
  • 3,872
  • 6
  • 36
  • 61
1
vote
1 answer

SwiftUI: NavigationView in containers

SwiftUI beginner here. I've been stuck on this for the last 8 days or so. I've watched dozens of videos and searched for hours but cannot find the answer. I know that it's something very obvious and simple, but I can't figure it out. I have a very…
1
vote
2 answers

SwiftUI and double navigation bar

I'm having trouble with navigation bar in SwiftUI. I have 3 views: ViewOne: contains the navigation view and two tab views ViewTwo: contains multiple navigation links ViewThree: contains multiple navigation links I know you should only have one…
Booysenberry
  • 223
  • 3
  • 16
1
vote
1 answer

SwiftUI NavigationView pop itself when a datasource is finished loading

Let say you are loading some data from network when you are at screen A that it takes sometime. While you are waiting you can navigate to other screens by using NavigationLink. So, at the moment you are at the screen B then the data from network is…
1
vote
1 answer

NavigationView issue with "Form" Picker inside NavigationLink child

I have a trouble trying to put my Picker inside NavigationLink child struct. MyProblem As you see after some transition (Main Page -> Testing Page -> Picker) and choosing any pickers desire option it navigate me back to Testing Page, but Picker…
1
vote
1 answer

SwiftUI Navigation Bar Item with different destinations

I have a Navigation View with an Add button(NavigationBarItem) and want to set a different destination of the Navigation Bar item in each tab. enum Tab: String { case income = "Income" case expenses = "Expenses" case budgets = "Budget" …
1
vote
1 answer

How do I have a SwiftUI navigation link selected when you open the app

I have created a sample project to explain this better. When you open the settings app on iPad, the right side of the screen shows the general settings and the left side shows the general settings navigation link selected Image of settings app But…