Questions tagged [swiftui-navigationlink]

For questions about NavigationLink - a component in Apple's SwiftUI framework that triggers a navigation presentation when pressed. When using this tag also include the more generic [swiftui] tag where possible.

Links:

974 questions
0
votes
0 answers

Make NavigationLink destination view executed "onShow"

I am building a fitness app where user selects one of the programs from the list and when he clicks on selected program a new view appears with video playing (video has it's countdown timer on it). I built the screen using…
eugene_prg
  • 948
  • 2
  • 12
  • 25
0
votes
0 answers

Updating an @ObservedObject of the MainView from the DetailView forces the exit from the DetailView

I use a list of lists as a structure, in the MainView I show the lists and through a NavigationLink I show the DetailView of each list which contains a list of objects. From the DetailView i can add or delete these objects and when I do so I also…
0
votes
1 answer

.onDisappear() method isn't triggered when clicking the NavigationLink, SwiftUI

NavigationView { List{ ForEach(self.data.firebaseObj.lists, id: \.self) { item in NavigationLink( destination: DetailView( list: item, …
0
votes
1 answer

SwiftUI detail view displayed at the bottom of the screen

I am using SwiftUI to create NavigationLinks from a List's rows to detail views in a NavigationView. In my CustomView I have 2 Groups: The first Group contains app logo and a search bar The second contains a List (that I use to show search results)…
0
votes
2 answers

View does not update when pushed using Navigation Link

I am facing an issue where the view does not update automatically with the @Observable object. struct Person: Identifiable { var id: Int var name: String init(id: Int, name: String){ self.id = id self.name = name } } class…
Amrit Sidhu
  • 1,870
  • 1
  • 18
  • 32
0
votes
1 answer

Update a Picker (SwiftUI)

I would like to present to the user a picker choice after having selected it with an AddView. The EditView launched by a DetailView shows me the Textfield full but the Picker is still empty although I've selected an item before. I've created two…
0
votes
1 answer

out of index when i try to remove one row in a listview with navigation link

struct PocketListView: View { @EnvironmentObject var pocket:Pocket var body: some View { NavigationView{ List{ ForEach(self.pocket.moneyList.indices,id: \.self){index in …
DarylPan
  • 33
  • 1
  • 4
0
votes
1 answer

How to push on new screen after dismiss model sheet in SwiftUI?

I Have to Implement like To create a login screen in the screen user can enter mobile number and click on the login button model sheet will open for top verification after OTP verification sheet must be dismiss and navigate on the…
0
votes
1 answer

SwiftUI NavigationLink

I'm working on a SwiftUI practice app and I ran into an issue with the NavigationView/NavigationLink. I am currently using the Metropolitan Museum of Art API and I wanted to make a list of departments that segues to another list of objects in that…
0
votes
1 answer

Creating custom data from .sheet(isPresented) from array

I am trying to have user click on image and take them to a different view where it has same image and text from array on that view and for each time they click on image in scollview the view pops up with that information. It will take data from…
Robert
  • 9
  • 2
0
votes
1 answer

Button not changing view in SwiftUI

So in my ContentView.swift, I have this code: import SwiftUI extension UIScreen{ static let screenWidth = UIScreen.main.bounds.size.width static let screenHeight = UIScreen.main.bounds.size.height static let screenSize =…
BotaGuy
  • 151
  • 1
  • 6
0
votes
0 answers

How do I implement a NavigationLink into a Button(action: { })

I have a problem: I don´t know how to implement a NavigationLink into a Button -> I want to create a Button named "Order now" for a shopping app. Depending on the payment that was chosen by the user I want to show different views after the user…
0
votes
1 answer

how to have a navigationLink contain a Text and a Image

I am building a recipe app in SwiftUI. I have created the home screen with a few lists of a view which I created in a separate file. (see picture, I don't have all the images yet, so I have the same image for all views) I want to embed the view…
BSM
  • 87
  • 2
  • 12
0
votes
0 answers

How to avoid spacer in NavigationView with Forms?

I have an NavigationView with an NavigationLink, when I get to the second View I have a strange spacer between the head and the beginning of my form: This is my code: struct SampleView: View { var body: some View { NavigationView { …
gurehbgui
  • 14,236
  • 32
  • 106
  • 178
0
votes
1 answer

Close view in swifui

i have an error when I close a view in swift ui. I have this the video. The view is opening and closing alone like a look. This is my code for opening the detail view. VStack(alignment: .leading) { Text("Les…
Mathieu Cloart
  • 121
  • 2
  • 11