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
1 answer

PresentationMode.dismiss weird behaviour when using multiple NavigationLinks inside ForEach

My app has 4 views (let's call them View_A[root] -> View_B -> View_C -> View_D). The navigation between them was made using NavigationView/NavigationLink. When I call self.presentationMode.wrappedValue.dismiss() from the last view(View_D) I expect…
eugene_prg
  • 948
  • 2
  • 12
  • 25
0
votes
1 answer

SwiftUI NavigationView on MacOS leaves padding above List

I have a NavigationView that leaves what looks like padding above the List of NavigationLink's and I can't work out how to get rid of it? Here's the view that calls the NavigationView: struct SearchView: View { @EnvironmentObject var…
mousebat
  • 474
  • 7
  • 25
0
votes
0 answers

SwiftUI Hosting Controller is still present after dismissing

I keep receiving errors in my debugger saying: 2020-07-18 15:59:07.256759-0400 ThePillowApp[22009:7205609] Warning: Attempt to present on…
0
votes
1 answer

SwiftUI Button not being registered properly

Ok so basically I was able to follow a tutorial and create this sleek Navigation Bar below: Here's a snippet of how programmed that in swiftui: NavigationView { HStack{ Spacer() NavigationLink(destination: Main(),…
Maanas
  • 43
  • 8
0
votes
1 answer

SwiftUI SceneDelegate - contentView Missing argument for parameter 'index' in call

I am trying to create a list using ForEach and NavigationLink of an array of data. I believe my code (see the end of the post) is correct but my build fails due to "Missing argument for parameter 'index' in call" and takes me to SceneDelegate.swift…
SD449
  • 97
  • 1
  • 7
0
votes
2 answers

Push the navigation link with the updated @published variable

I updated the published var chats in a sheet. And when the sheet is dismissed (by button press), the MessageView navigates to ChatView. I hope to use that updated chats in the ChatView, but now when it's first pushed, chats isn't updated, until you…
0
votes
0 answers

How to hide navigation bar only in first view when using SwiftUI and UIKit views

I have a main view that I'm using swiftUI for and I want to hide the navbar for. I've used .navigationBarTitle(Text("Home"), displayMode: .inline) .navigationBarHidden(true) to hide the navbar on this main page. My problem is that I use a…
0___0
  • 1
0
votes
1 answer

SwiftUI List not propagating touches

Trying to work with SwiftUI and experiencing a weird issue. I have a List of Views that should be clickable to push to a detail view, swipable to delete, and have a couple of interactive elements in the view. The list is more or less set up as…
Slayter
  • 1,172
  • 1
  • 13
  • 26
0
votes
2 answers

SwiftUI: Detecting selection change in NavigationView on tvOS

I am building a SwiftUI application for tvOS and am currently trying to implement UI. I have NavigationView at the bottom and label at the top and I want label to show which NavigationLink is currently in focus. Here is my code: @State private var…
Hekes Pekes
  • 1,175
  • 2
  • 12
  • 28
0
votes
1 answer

NavigationView cannot pull down after the LongPressGesture NavigationLink is full of screen

When I use LongPressGesture in NavigationLink, the NavigationView cannot pull down after the link is full of screen because the LongPressGesture and NavigationView's pulling down have conflicts. The code is as following: VStack{ …
Muz
  • 699
  • 1
  • 11
  • 25
0
votes
1 answer

How to navigate to some view from apns click in SwiftUI?

In swift 5 and UIKit on clicking apns I have been pushing to the desired view controller by fetching the top view controller and push the desired view controller over top view controller. But in SwiftUI I am not able to do that. How can I navigate…
0
votes
0 answers

How to prevent hidden SwiftUI view from redrawing from @Published variables?

I am building a chatting app: I have InboxView and MessagesView, to put it simply both are listening to a @Published variable called chats. When user sends a message in MessagesView, the ranking of inbox changes and because InboxView is listening to…
Zorayr
  • 23,770
  • 8
  • 136
  • 129
0
votes
2 answers

how to make the code simpler and more reusable for navigation links with multi dimension dictionary in swiftui?

I have a multi-level dictionary that I need use to build navigation links. Now I have a 2-level depth dictionary: let multiDimDict: [String: [[String: [String]]]] = ["A": [["A1": ["A11", "A12"]], ["A2": ["A21", "A22"]]], "B": [["B1": ["B11",…
mic
  • 155
  • 2
  • 9
0
votes
1 answer

SwiftUI deep linking with NavigationLink inside List onAppear with tag: and selection: doesn't activate link

Trying to build deep linking into a list of NavigationList items; I will be reading a value on the SwiftUI view's .onAppear and based on that value, navigate to a specific cell. There are three issues that come up with different setups I have tried:…
Zorayr
  • 23,770
  • 8
  • 136
  • 129
0
votes
1 answer

Unable to navigate to second view from Navigation bar Swift UI

I want to move to the next view when clicked on "Click me" button. But didn't find any method to do that. I have tried NavigationLink and they dont work inside navigationBarItems. If I remove navigationBarItems then all items are displayed in the…
Adnan Afzal
  • 167
  • 1
  • 3
  • 8