Questions tagged [swiftui-navigationstack]
For questions about SwiftUI's NavigationStack, a view that displays a root view and enables you to present additional views over the root view.
289
questions
0
votes
1
answer
268
views
SwiftUI: NavigationStack appends all items of list
I have a NavigationStack in SwiftUI and an ObservedObject and enum that handle the routing.
enum Route {
case location(location: Location)
}
extension Route: Hashable {
func hash(into hasher: ...
0
votes
0
answers
65
views
Add space between NavigationStack toolbar and other elements
I am trying to add space between the yellow toolbar and the MiniView element below. When I add space, it looks like it extends the toolbar.
The space needs to be similar to the space between the ...
0
votes
1
answer
330
views
Share ViewModel only across specific views in NavigationStack
I have a NavigationStack with three forms inside it and each form has a couple of screens. How can I share a form's ViewModel only across its screens without having to create an instance globally( ...
0
votes
1
answer
275
views
Dismiss all the NavigationLink View to go back to Starting View from the third View
This is a simple code that I am trying to test for my required feature.
I want to be able to click on the button or something to take me back to the FirstView without me needing to click the back ...
0
votes
1
answer
773
views
SwiftUI nested navigationDestination causes multiple init of @StateObject
I am building a navigation system based on NavigationStack and modifiers .navigationDestination().
What I am trying to achieve: I need to build a View hierarchy with navigation:
- ContentView
- ...
0
votes
0
answers
17
views
SwiftUI4.0 NavigationStack(path: $pathList) + CustomNavigationBar How can I manage PathList when doing swipe back?
When using NavigationStack and CustomNavigationBar together, I don't know how to manage PathList for Swipeback action. Do you know anything?
public func navigationController(
...
0
votes
0
answers
71
views
Transition from inline to large navigationBarTitleDisplayMode is not smooth
The transition from the "detail view" which has inline title style to the "main view" which has large title style is not smooth. When I navigate from "detail view" the ...
0
votes
1
answer
505
views
SwiftUI | Strange behaviour after appending paths to Routerpath onAppear
I want to completely rework how NavigationBar's look and rework back button as I like and have my own router In my app.
I created this sample project to understand how NavigationStack and ...
0
votes
1
answer
299
views
NavigationView doesn't update when @State changes (NavigationStack works well)
I encountered this situation when trying to replace my NavigationStack (iOS 16+) by a NavigationView (for backward compatibility reasons). What I hoped for would be that NavigationStack and ...
0
votes
0
answers
680
views
NavigationStack and NavigationDestination, using NavigationPath Correctly passing data
I am trying to pass data from one View to another using @StateObject navigating using NavigationStack and NavigationPath. In my case I can't use NavigationLink.
To achieve that a came up with this ...
0
votes
1
answer
1k
views
NavigationLink does not append to path inside NavigationSplitView/NavigationStack
The following code shows that $path is always 0, despite tapping a NavigationLink inside the stack. That means that when I select a panel, and tap on the navigation link to go to 'firstPanel subview', ...
0
votes
0
answers
268
views
path.removeLast() throws EXC_BAD_INSTRUCTION
I have NavigationStack with NavigationPath:
...
@State var path = NavigationPath()
...
var body: some View {
NavigationStack(path: $path) {
VStack() {
MyView() {
...
0
votes
0
answers
266
views
NavigationDestination sliding transition not working
struct First_View: View {
@State var secondViewShown = false
var body: some View {
NavigationStack {
VStack {
Text("Step 1")
...
0
votes
0
answers
47
views
SwiftUI - PopToRoot IOS 16
In the below code please let me know how to perform popToRoot like from the rewards view to menu view thats my root view , using the navigation stack and navigating through the navigation link & ...
0
votes
0
answers
175
views
Strange navigation with NavigationStack inside NavigationSplitView
Why does "Above NavigationStack" disappear when I click "Nav Link"?
struct ContentView: View {
var body: some View {
NavigationSplitView {
// Sidebar ...
0
votes
1
answer
71
views
Show detail page default in iOS with SwiftUI
I want to show the detail page on opening the app with back button. On clicking the back button list of accounts should display. Just like the iOS default mail app.
I'm using the NavigationStack, ...
0
votes
1
answer
213
views
SwiftUi NavigationLink opening multiple views at once
NavigationStack {
TextField("Factor Name", text: $factName)
.textFieldStyle(.roundedBorder)
.padding()
...
0
votes
1
answer
280
views
Reusable view with NavigationStack and size of visible cells / SwiftUI / Swift 5
I was wondering if you could help me with a SwiftUI question. Specifically, I'm trying to create a reusable view that includes a NavigationStack with ForEach loop and has adjustable cells sizes. Can I ...
0
votes
1
answer
108
views
NavigationStack not showing master-detail view on iPad in landscape
I've the following code which displays a master-detail view on iPad when in landscape.
However, when I use NavigationStack it collapses views as on iPhone.
What am I missing here?
Or how to achieve ...
0
votes
1
answer
277
views
How do I get rid of "A navigationDestination for AppExample.ViewOptions was declared earlier on the stack. Only the destination declared closest .."
I have implemented a navigation stack and enum following https://stackoverflow.com/a/74362840/21094465 yet I am still receiving the following "A navigationDestination for AppExample....
0
votes
1
answer
290
views
NavigationStack embedded in View
In my app I have a View inside another, and I want to navigate to another view from the subview, with a NavigationStack. The problem is that the navigation takes place at the top view level.
I only ...
0
votes
1
answer
128
views
How to navigate back programatically using nested navigationDestination in SwiftUI
I'm trying to implement programatic nested navigation using NavigationStack and navigationDestination(isPresented:). But I can't figure out why I can't navigate back to A (button Go back to A is not ...
0
votes
1
answer
543
views
Confirm Stripe payment in SwiftUI (iOS 16)
I am using Stripe API to accept card payment in SwiftUI.
I managed to make successful payment using STPPaymentCardTextField wrapped in UIViewRepresentable and confirm it using the provided sheet ...
0
votes
0
answers
989
views
SwiftUI NavigationStack .searchable .onSubmit
I have MainView and where I have NavigationStack. I need to make it so that when I press the Search button, another view is shown and when I press the Cancel button, it is hidden again.
var body: some ...
0
votes
3
answers
468
views
iOS 16 NavigationLinks in nested Lists unclickable
I am running xCode 14.2 on iOS 16.2 simulator and iOS 16.1.2 device.
I have, in my app, NavigationLinks in sublists that are implemented as nested Lists. After updating my xCode, suddenly the ...
0
votes
1
answer
559
views
How to fix double back button in SwiftUI
I got 2 views. On the second view I have list of exercises and when I choose one of them and go inside I see double back. It's driving me crazy.
First one:
import SwiftUI
struct ProgrammView: View {
...
0
votes
1
answer
135
views
NavigationLink don't navigate anymore after incomplete swipe from left to right
In my app I have a NavigationStack inside the detail of a NavigationSplitView. With the code below the navigation back and forward works fine but if from the detail, I incompletely swipe left to ...
0
votes
0
answers
237
views
How to open custom view and bottom sheet in tabbar views and Subview with sticky bottom tabbar in SWIFTUI?
Given code is for custom bottom tab-bar with plus button in center by using we need to hide and show one detail view and from last tab we are just opens menu from bottom sheet.
Problem :- When we are ...
0
votes
1
answer
158
views
NavigationStack; View contents below navigation area(s)
I have a simple view that is somewhere in my navigationstack hierarchy. But the content is below the navigation areas top and bottom. How to solve this?
I have not set to ignore safearea edges. What ...
0
votes
0
answers
89
views
SwiftUI Navigation - List loading multiple time after navigating from details
I am creating a SwiftUI List with Details.
This list is fetching JSON data from Firebase Realtime. The data consist of 5 birds with an ID, a name and an image URL.
My problem is the following:
Each ...
0
votes
2
answers
584
views
passing an array of views in navigation Destination in SwiftUI iOS16
In the old style of NavigationView I was able to assign manually each view in a Navigation Link. However in iOS16 I don't know how to pass a list of view [MovieTitles(),Literature(),TrafficLights(), ...
0
votes
1
answer
599
views
Make Custom SwiftUI Views with ObservedObjects compatible with NavigationLink iOS 16
I don't feel that the following example is exhaustive (from Hacking With Swift). A lot of online examples tend to keep it quite elementary like this, where NavigationLinks are implemented based off of ...
0
votes
2
answers
165
views
NavigationStack with array from relationship
I am doing navigation stack for the array of related entries
var body: some View {
NavigationStack(path: $navPath){
VStack {
List(Array(plant.event as! Set<Event>), id: \....
-1
votes
1
answer
49
views
Why does swift navigation list with button open a sheet multiple times instead of just once?
TLDR: In the following code, clicking on the button from the top level ContentView opens multiple sheets, and then when closing the sheet it gets triggered again; yet clicking it from the RowView only ...
-1
votes
1
answer
44
views
NavigationStack and binding to a selection
I'm developing a watch app similar to Apple's demo workout app, but as of watchOS9 NavigationView has moved to NavigationStack.
In the demo, a list of workouts are presented; when a workout is ...
-1
votes
1
answer
71
views
NavigationLink takes me to the parent view of the view with the navigation stack on it
I am new to SwiftUI and I am simply experimenting with different NavigationStack options. I have a navigation stack that shows a list of words. When the user clicks on the navigation link it shows a ...
-1
votes
1
answer
595
views
Getting crash while going back in Navigation Stack, Not getting much out of back trace
I am getting crash while getting back from navigation stack. Basically, I was trying to migrate from NavigationView to NavigationStack.
below is the stack trace, some how not getting any hint why it's ...
-2
votes
1
answer
78
views
Passing data through Navigationlink with custom views - SwiftUI
Im trying to pass two kinds of different JSON data in an app with two different views in two navigationlinks, what works
One custom view which with the name LaundryList that gets passed in the ...
-3
votes
1
answer
70
views
NavigationPath(_items: SwiftUI.NavigationPath.(unknown context at $7ff84b690a28) Representation.eager([SwiftUI.(unknown context at $7ff84b6907f0).C
I tried to use navigationstack, and it works. but couldn't print the path, and with the message: " NavigationPath(_items: SwiftUI.NavigationPath.(unknown context at $7ff84b690a28).Representation....