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

Migrating to NavigationStack with .toolbar

Currently, I have a settings button inside the toolbar that when I tap on it it will open the SettingsView(). Here's my implementation below. @State private var goToSettings = false NavigationView { ZStack { NavigationLink(destination:…
-1
votes
1 answer

SwiftUI: How to reduce spacing between .navigationTitle and Section in a InsetGroupedListStyle

I have a list that I navigate to from a navigationLink. How do I reduce the space between the title and the start of the list? Applying a padding causes visual artifacts when entering the view.
-1
votes
1 answer

XCode IOS How to get rid of the back button on home screen?

I have a project with NavigationLink that leads a login screen into a main menu which is intended, but there is a back button that leads back to the login screen which I want to get rid of. How would I do so?
sizzyd
  • 1
  • 1
-1
votes
1 answer

SwiftUI - How to make list Line Separator Inset like iOS Settings App

I'm trying to achieve the behavior that's also seen in in the iOS Settings App(see screenshots below). I'd like to get title is align to the line separator, not to icon. I first try list with section ,code is TestView1(), the inset is align with…
mars
  • 109
  • 5
  • 21
-1
votes
1 answer

Swift UI Navigation Link not working with tap gesture

I am having an issue with a navigation link with a tap gesture in Swift UI. What happens is that once I tap the navigation link, the code works fine, my function on the tap gesture adds the item to the cart and I get redirected to the NavLink…
-1
votes
1 answer

How can I remove duplicate elements from a list in SwiftUI

I can't put the categories variable anywhere in ConsoleList as I always get an error. I get: "Value of type '[AnyHashable : Any]' has no member 'category'" import Foundation let imgName: String = "" let consoleName: String = "" let description:…
-1
votes
1 answer

NavigationLink doesn't work with a button

I tried adding a NavigationLink without a NavigationView on another project and it worked. However when I tried copy and pasting the code onto another project, it doesn't work. Please help. I've tried testing it on an empty project and it doesn't…
54Hex
  • 47
  • 8
-1
votes
1 answer

dynamic content not updating in list Swift UI

I am having real trouble here. I have a list that I am trying to add a new item to the list each time I add a new line of data to my data file however it is just showing the same data. I have scoured the internet and even tried following the apple…
-1
votes
2 answers

Present modal view on navigation to another view in swiftui

Let me know if this is a duplicate question. I am developing an app with a photo picker. I am on view A and there is a + button on it. When I tap on the +, I want to navigate to a view B. Upon navigation I want to present a Photo Picker view…
Alejandro Vargas
  • 1,327
  • 12
  • 26
-1
votes
1 answer

Moving to Next View after Login Verification in SwiftUI iOS

this is not a duplicate QUESTION....after reading many resources on net not able to figure out all resources points out to navigation link or if else with boolean to move to next view, which after applying dont work or not the requirement. Not able…
tintin
  • 335
  • 2
  • 8
-1
votes
1 answer

Closing A View From Another View

I am still learning SwiftUI and I have come across a small problem. In my app, I have a main view. On the top is a search bar and at the bottom, a menu with different buttons. I want to change views when clicking those buttons. However, I only want…
-1
votes
2 answers

I can't pass data by using @Binding from one View to other

i created a weather app, which download current weather data by city name (user type it) and put this data inside a list - it work's. But i also created WeatherDetailView() which, should show a detailed data like, hourly forecast for current…
malczan
  • 33
  • 5
-1
votes
1 answer

How to declare a protocol with a function that returns NavigationLink

I want to declare a protocol that has function which must return NavigationLink. But when I try this it returns an error "Reference to generic type 'NavigationLink' requires arguments in <...>" protocol Protocol: class{ func function() ->…
-1
votes
1 answer

【SwiftUI】How to initialize an empty struct

I need some kind help in SwiftUI. I have a model below that takes in JSON data. When I want to initialize it as an empty array, it should be simple, just stating Answers, but how can I initialize it not as an array but an empty single data…
Hiro
  • 155
  • 1
  • 10
-1
votes
1 answer

How to set up SwiftUI toolbar to display in the center of the view

I am experimenting with SwiftUI ToolbarItem in various positions in my view, such as in bottomBar and navigation. I am wondering if it is possible to center the ToolBarItem vertically in the view, as opposed to the top or bottom. When setting up the…
1 2 3
64
65