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
2 answers

Swiftui NavigationLink not executing

I'm trying to but a NavigationLink in a LazyVGrid and I'm having a bit of trouble with the navigation. I would like that when the color is clicked that I could segue to the next page. Here is some code: Here is how the start page looks here Here is…
Michael
  • 5
  • 2
0
votes
1 answer

Passing data across views for unique objects in a forEach loop in swift

I have two views, ViewAssignment and TaskDetailView. My ViewAssignment page fetches data from an environment object, and creates a list using the data. Upon each item of the list being clicked on, the TaskDetailView pops in as a navigation link,…
0
votes
1 answer

SwiftUI - TabView/NavigationLink navigation breaks when using a custom binding

I'm having trouble with what I think may be a bug, but most likely me doing something wrong. I have a slightly complex navigation state variable in my model that I'm using for tracking/setting state between tab and sidebar presentations when…
Ryan
  • 145
  • 1
  • 6
0
votes
0 answers

SwiftUI problems with Multiplatform NavigationView

I'm currently having all sorts of problems with a NavigationView in my multi-platform SwiftUI app. My goal is to have a NavigationView with an item for each object in a list from Core Data. And each NavigationLink should lead to a view that can read…
0
votes
0 answers

Correctly using NavigationLink without NavigationView Swift UI

I have a customtab bar that I've implemented through a tutorial. Below is the HStack for this custom bar. struct CustomTabBar: View { @Binding var selectedTab: String @State var isLinkActive = true // Storiing Each Tab…
Kamanda
  • 305
  • 3
  • 4
  • 11
0
votes
2 answers

How to set the color of a NavigationView symbol button

My currently have a NavigationView with an embedded ToolbarItemGroup containing buttons with SF Symbols. I'm attempting to change the Trash button's color to that of red. var body: some View { NavigationView { Text("Hello, World!") …
JDev
  • 5,168
  • 6
  • 40
  • 61
0
votes
1 answer

Dismiss Tab View from a Child Navigation View and go back to RootView SwiftUI

My Navigation Flow: Here, my View A to View G is under one Navigation View. NavigationView { ViewA() } And from View D & View G I am moving to my TabView H by modal, like this: Button(action: { isPresented.toggle() }, label: { …
Tulon
  • 4,011
  • 6
  • 36
  • 56
0
votes
0 answers

Warning logs when using NavigationView in TabView, but not working in iOS 14

I have very simple code, like so: struct ContentView: View { var body: some View { TabView { FirstView() } .tabViewStyle(.page) } } struct FirstView: View { var body: some View { …
George
  • 25,988
  • 10
  • 79
  • 133
0
votes
2 answers

SwiftUI - View not updating after adding linked object in Coredata

I have a SwiftUI view called InstanceView, which shows the details of an Instance from a NagivationView. The links in the NavigationView are objects from Coredata called Instances, and also in Coredata, I have an entity called Solve. Instance has a…
Cameron Delong
  • 454
  • 1
  • 6
  • 12
0
votes
1 answer

SwiftUI NavigationView Toggle Tint Color

I have two navigation views. The parent is white labeled and the child is black labeled. When I revisit the parent view from the child view the child modifier is still applied. i.e the labels are white instead of black. I understand that applying…
tintin
  • 107
  • 2
  • 6
0
votes
0 answers

How to change the way items in a list are move by the user (SwiftUI)

I'm building a macOS app with a sidebar which has elements that the user can rearrange. I'm using .onMove() to detect when the user moves an elements and a function to move the item. Here is my code for that: NavigationView { List() { …
Cameron Delong
  • 454
  • 1
  • 6
  • 12
0
votes
1 answer

My two attempts at getting a blurred background for a navigation title in SwiftUI are not working

Beginner here making a simple todo list, but trying to get a blurred background only for the navigation title. I'm trying to do this with and without a UIViewRepresentable struct. Here is my method without the UIViewRepresentable struct. """ struct…
0
votes
1 answer

SwiftUI SidebarListStyle inside of NavigationView's Style

i'm new with SwiftUI. My goal is to make List which listStyle is SidebarListStyle just exactly like this [first][1] and here's my code List{ MyProfile() Section(header: Text("친구 102") …
0
votes
0 answers

SwiftUI UINavigationBar does not ignore the top safe area. How to get rid of empty space on the top?

Code I used to create an example of this navigation bar: struct ContentView: View { init() { let defaultAppearance = UINavigationBarAppearance() defaultAppearance.configureWithOpaqueBackground() …
0
votes
1 answer

How can I update the navigation title when I select a new tab?

I have a tabview with three SwiftUIViews (HomeView, FavoritesView and ContactsView) each of these views look like this Home View below. struct HomeView: View { var body: some View { VStack { Image(systemName: "house.fill") …