Questions tagged [swiftui-navigationview]

For questions about NavigationView - a view in Apple's SwiftUI framework that presents a stack of views representing a visible path in a navigation hierarchy. When using this tag also include the more generic [swiftui] tag where possible.

Links:

583 questions
0
votes
0 answers

Why is @Binding view not updating when navigated from inside swipeActions even when model is changing?

I am trying to pass a binding to another view that accepts a binding to make changes directly to the model. Whenever I am passing the Binding through a NavigationLink wrapped around the view inside a ForEach, it works fine and any changes made in…
0
votes
0 answers

SwiftUI: Using FocusState in NavigationView doesn't dismiss the keyboard properly

While implementing a SwiftUI only application I'm using NavigationView for iOS 15 / NavigationStack for iOS 16, Keyboard doesn't dismiss properly under different conditions When using NavigationView + FocusState and running on iOS 15 phone it works…
0
votes
1 answer

In SwiftUI how do I push a DetailView in a NavView when adding a new item to a List?

It seems so weird that I couldn't find anything. Isn't this a common problem? So, I have a list in a NavigationView/-Stack and have a .toolbar add button. When tapping that button it should open a DetailView as a navigation detail view (not a…
0
votes
2 answers

fullScreenCover not updating data for the content view

.fullScreenCover(isPresented: $viewModel.showEditRoom) { EditRoomView(someData: someData, selectedRoom: $viewModel.selectedRoom) } I have a fullScreenCover modifier that presents a view when a certain condition is met. The view that…
0
votes
0 answers

Prevent Sheet Background to be white when navigating with NavigationLink within sheet

I am trying to have a sheet with 2 buttons to navigate to different views. This works fine with a NavigationView + NavigationLink. It navigates as expected to another view. However I am dealing with this: First I as expected see the…
0
votes
1 answer

How to center views vertically as if there were no navigation title?

I have a NavigationStack/NavigationView which loads its links. When it's loading or contains no links, I want to display a view centered in the screen to inform the user. However, when there's a navigation title (.navigationTitle()), it takes space…
0
votes
0 answers

SwiftUI layout issue for embedded TabView in NavigationView on watchOS

I have noticed a very strange issue when using two embedded TabView in a navigation view. My code sample show a TabView (page mode) imbedded in a NavigationView. One of the tabs (tag 2) is also a TabView (verticalPage mode). When I first display…
0
votes
1 answer

Use dismiss() to pop view from NavigationStack with different animation

I am using the @Environment(.dismiss) private var dismiss and than dismiss() to pop current view from NavigationStack. In my app it should look like going forward however, rather than backwards. When I use dismiss() the animation is sliding from…
0
votes
0 answers

Navigation Bar No Longer Showing from Storyboard in Controller - Swift (Updated View Controller To Handle Opening Links WEBVIEW)

With the following code, I was able to display my Navigation Bar build on Storyboard, however, andy URL links would not open and were dead. I found my ViewController needed a way to handle using a decision handler. (SEE WHAT DID I TRY…
0
votes
0 answers

Open a view on the top of the navigation stack from a nested child view

I am looking to present a new view properly on top of the navigation stack in SwiftUI. If I have a navigation stack, with A being the root view: A -> B -> C -> D -> E In this scenario, I have a method on view B that has an onOpenURL(perform:)…
0
votes
0 answers

SwiftUI: TabBar inside of a split NavigationView?

I have an iPad app I am writing with SwiftUI. I would like to have a split NavigationView with the left-hand (navigation) side displaying a TabView and the right-hand (content) side displaying other various views. I am seeing some strange…
Shadowman
  • 11,150
  • 19
  • 100
  • 198
0
votes
1 answer

How to prevent view items from shifting when item is hidden in SwiftUI

I am coding a SwiftUI view file that prompts the user to enter their date of birth. After all fields have been appropriately entered a navigation button appears to navigate to the next step. My only problem is when the button appears it shifts all…
Sam
  • 11
  • 3
0
votes
1 answer

SwiftUI - Remove space over navigation title

Is there a way to remove extra space over navigation title (scribbled it in Red in below screenshot). I am working with iOS 15. Code: import SwiftUI import Foundation struct ContentView: View { let names = ["Holly", "Josh", "Rhonda", "Ted"] …
tech_human
  • 6,592
  • 16
  • 65
  • 107
0
votes
1 answer

How to override default behaviour of NavigationView and NavigationStack in SwiftUI?

I'm curious, is there a way to override the default slide-in behaviour when navigating in SwiftUI? Here's some code where I'm unsuccessfully attempting to use .transition to affect the animation: struct TransitionOnNavigation: View { var body:…
0
votes
0 answers

SwiftUI Router class to navigation UIKit View controller

I am using SwiftUI router which also support iOS15 (can not use NavigationStack)to navigate though different SwiftUI views. But i also want to push viewController i.e UIKIT class. Protocol: protocol Router { associatedtype Route func viewFor
IOSDev
  • 205
  • 2
  • 10