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
3
votes
0 answers

How to remove the separator line of navigation bar in swiftui?

Not able to remove the separator line. Tried setting background image and adding attributes, setting background colour but none of these are working. After setting isTranslucent true, for colours other than white separator is not visible but in…
3
votes
1 answer

How to Keep state of my View Model persistent across a user session in SwiftUI (MVVM)?

I am trying to implement an IOS App following the MVVM architecture. Everything works well when I don't need my state to be persistent as I move through views and navigate back. However, when a user navigates two or three steps back to View, I want…
3
votes
1 answer

How to preserve Accessibility focus in List when navigating back from the next View in a NavigationView?

I have a NavigationView were a user can select a chapter in a List to navigate to the contents of that chapter. The problem is that when navigating back from the text to the chapters view, Accessibility does not preserve focus on the selected…
Melodius
  • 2,505
  • 3
  • 22
  • 37
3
votes
1 answer

SwiftUI Toolbar In a TabBar View

My first view has a NavigationView with a Tab Bar View struct TestView: View { var body: some View { NavigationView { TabTestView() } } } In the Tab Bar, I have two views, say TestView1 and TestView2. struct…
3
votes
0 answers

Unable to remove Navigation Bar when TabView is used inside the Navigation View - SwiftUI - iOS 15

SwiftUI View Hierarchy Navigation View --> VStack --> Custom SearchView --> TabView In the view, with the hierarchy mentioned above, I'm unable to remove navigation bar. It's visibility is successfully changed with the code mentioned shared…
Subhan Ali
  • 1,370
  • 13
  • 17
3
votes
1 answer

SwiftUI - Make toolbar's NavigationLink use detail view

I'm working on a two-pane SwiftUI app with a sidebar and detail pane in a DoubleColumnNavigationView. I would like to open a NavigationLink from the toolbar of the sidebar into the detail pane, as seen in "open from sidebar" in the gif…
3
votes
1 answer

TabView is not switching tabs properly in SwiftUI

I'm having a weird problem that I can't seem to figure out with SwiftUI. I have a TabView in my ContentView, there are 3 tabs (chat list, user list, and profile) the app loads up on the chat list tab. The problem is, when I select the second tab…
Neglected Sanity
  • 1,770
  • 6
  • 23
  • 46
3
votes
1 answer

How to dismiss sheet from within NavigationLink

In the following example, I have a view that shows a sheet of ViewOne. ViewOne has a NavigationLink to ViewTwo. How can I dismiss the sheet from ViewTwo? Using presentationMode.wrappedValue.dismiss() navigates back to ViewOne. struct ContentView:…
3
votes
2 answers

SwiftUI: NavigationView inside TabView height not occupying the fullscreen

I seeing an unexpected UI issue in my SwiftUI project when I add a NavigationView inside a TabView. Here's my code, struct MainView: View { @State private var selectedTab: Int = 0 var body: some View { TabView(selection:…
3
votes
0 answers

SwiftUI NavigationView Unexpected Pop to Root

I've created some SwiftUI code that use an EnvironmentObject to store boolean values for popping back to the root view and another EnvironmentObject to store a score variable that is intended to be used across multiple views. In this example, I have…
3
votes
0 answers

Navigation Bar buttons not working after sheet dismissed. UINavigation wrapper?

I am working on a SwiftUI app, and I have a NavigationView with some buttons in the navigation bar. The problem is that after dismissing a full-page sheet (triggered by a button, not in the navigation bar), those buttons stop working. I've tried the…
coopersita
  • 5,011
  • 3
  • 27
  • 48
3
votes
0 answers

SwiftUI Deep Link Navigation bouncing

I've built a deep linking schema with SwiftUI and have it mostly working. The only issue that I'm suffering from is that when I'm in the same tab and in a navigation stack, a deep link that routes to a different view in the same tab causes this…
3
votes
0 answers

SwiftUI re-renders inactive View after updating @Published property asynchronously

We are using SwiftUI with a NavigationView. We have one view (ParentView) that updates its data asynchronously through its view model (ParentViewModel) and then re-renders its body according to the new data. When the completion block is called after…
3
votes
0 answers

Need help regarding "pop to root" view implementation of a NavigationView in SwiftUI using a List container

I'm trying to implement a List of NavigationLinks that will allow me to navigate between views of up to 3 levels of navigation links. Main View -> View2 -> View3 -> View4 When I reach View4, the view will not have the default "back" button at the…
3
votes
1 answer

SwiftUI List rows with INFO button

UIKit used to support TableView Cell that enabled a Blue info/disclosure button. The following was generated in SwiftUI, however getting the underlying functionality to work is proving a challenge for a beginner to SwiftUI. Generated by the…
eklektek
  • 1,083
  • 1
  • 16
  • 31