Questions tagged [navigationlink]
73 questions
1
vote
0 answers
SwiftUI: How can i present a Popup using Navigation Link
I have this code embed in a Navigation View and i want RankingUserDetail presented as a Pop-up, i've tried changing the size of the View, using View.popOver style and looking for the presenting methods, can't figure out.
Already tried to change the…

Guilherme Dalosto
- 11
- 2
1
vote
0 answers
.edgesIgnoringSafeArea doesn't work properly
I have a NavigationLink inside my ContentView that shows a SecondView with some text. When I apply an .edgesIgnoringSafeArea modifier inside SecondView, the text goes beyond the screen and this only happens inside a NavigationLink when a…

xmetal
- 681
- 6
- 16
1
vote
1 answer
In a MacOS App using SwiftUI, how to modify the default blue background of a selected NavigationLink nested in a list?
Good day all. In a MacOS App using SwiftUI, how to modify the default blue background of a selected NavigationLink nested in a list? The list is inside a NavigationView. I could not find the solution here. What would be the code to add to the…

Wild8x
- 459
- 4
- 13
1
vote
1 answer
SwiftUI How to stop the animation of List in Multi-level NavigationView
I just want to stop the animation when I have a multi List in multi-level NavigationView. Maybe this is not "ANIMATION", I just want to fix that.
On Xcode Version 11.3.1 (11C504) + iOS 13.2
The code is simple and you can find out it's wired.
import…

GuoJing
- 13
- 1
- 1
- 11
1
vote
0 answers
SwiftUI NavigationLink destination (view) based on .gesture type
I understand that NavigationLink's are generally as so:
ForEach(xx, id: \.id) { x in
NavigationLink(
destination: oneView(x: x)) {
XItem(x: x) // Image + Text in VStack
}
}
However, what I want to do is the equivalent of…

Brendon
- 673
- 1
- 8
- 19
1
vote
0 answers
NavigationLink work on simulator but don't work on real device iPhone
I am new in SwiftUi and i try to run the code below.On simulator work well, but when try to run on real device (iPhone/iPad) work one time. The first time i can go to second view, but when i return with "
import SwiftUI
struct ContentView: View {
…

Logar
- 11
- 3
1
vote
2 answers
SwiftUI navigate to a new view by pressing Button
I am trying to navigate to a new SwiftUI file that I called HomePageView (Currently just consist of a red background and a text that says Home page.) The code below I tried to integrate with my Button which is 1 of 3 buttons on my initial view which…

bain
- 335
- 1
- 6
- 17
1
vote
1 answer
Issues upgrading ios13.1 to 13.2 - NavigationLink - tried to pop to a view controller that doesn't exist
I built an app using both UIKit and swiftUI.
It worked fine with ios13.1 but with ios 13.2 I have bugs:
I'm showing a SwiftUI View in a UIViewController (using HostingController). This view is composed with elements wrapped in NavigationLink.
When…

Emilie BELLIER
- 41
- 7
1
vote
2 answers
SwiftUI text field stops the event to fire NavigationLink when .simultaneousGesture attached
I have the following NavigationLink:
NavigationLink(destination:
TrendSlider(
title: .constant(title),
col: .constant(self.dataModel.queryColumnSeasonWinPercentageTeam1),
opIndx:…

jimijon
- 2,046
- 1
- 20
- 39
1
vote
1 answer
Call a NavigationLink programmatically?
Is it possible to call a Navigation Link programmatically?
It was possible, but now deprecated.
var link1 = NavigationLink("Link Text", destination: MyView1())
var link1 = NavigationLink("Link Text", destination: MyView2())
//Something like this
…

Yarm
- 1,178
- 4
- 16
- 29
1
vote
1 answer
SwiftUI Navigation Issues, 'Group' not resolving
Environment: Xcode 11.1 running on Catalina (19A573a) and building iOS only app.
I have the following code that should be fairly simple.
- I have buttons A - H (8 buttons)
- When I tap on a button I expect to be taken to a respective view (“View A”,…

xdeleon
- 769
- 8
- 20
1
vote
0 answers
SwiftUI - NavigationLink not triggered in correct location
I am running Xcode 11 GM2 and having issues with a NavigationLink not triggering where it is expected. The app I am working on is based on Apple's sample SwiftUI app found here. The problem I am having also happens in Apple's sample.
When I add the…

forrest
- 10,570
- 25
- 70
- 132
0
votes
1 answer
Reuse styled NavigationLink for another destination
I have styled a NavigationLink in a subview to reuse its styling again for other destinations.
This is the Code:
struct ContentView: View {
var body: some View {
NavigationView {
VStack {
…

I-O-ES
- 21
- 3
0
votes
2 answers
How to create SwiftUI List of NavigationLinks with dynamic view names
I am trying to create a simple list of Views for the user to visit, I cannot figure out how to replace view name with an array variable. In the example below destination: is hard coded as AVExample(), which is one of my views, but how do I use the…

Jmcg
- 239
- 2
- 9
0
votes
1 answer
SwfitUI How does a list push to different view dynamically
let datasource = [
"view1",
"view2",
"view3",
"view4",
"view5",
"view6",
...
]
I want to display datasource in a list, and push to different view, such as View1(), View2(), View3(), View4()...
What should I do in…

zzzwco
- 184
- 6