Questions tagged [swiftui-navigationsplitview]

45 questions
2
votes
1 answer

UICalendarView vs SwiftUI DatePicker wrong size in NavigationSplitView sidebar

Because i need to add badges to certain dates, i need to use a UICalendarView representable, however when using this in the NavigationSplitView sidebar, the width of the UICalendarView is incorrect... in contrast the graphical DatePicker which…
Peter Lapisu
  • 19,915
  • 16
  • 123
  • 179
2
votes
1 answer

SwiftUI NavigationStack inside NavigationSplitView not working on iPhone and iPad

I'm trying to use NavigationStack inside NavigationSplitView. struct ContentView: View { @State var mainMenu: MenuItem? @State var subMenu: SubMenuItem? var body: some View { NavigationSplitView { …
2
votes
0 answers

Using a two and three column interface in SwiftUI NavigationSplitView app

Now I am developing an application and faced with the problem of having to display two and three-column interfaces within the same application. Let's say that I have two views. The first one should display only the Detail View, and the second one…
1
vote
0 answers

NavigationSplitView with collapsable List and CoreData

I am trying to set up a collapsible List in my Core Data backed macOS app to allow navigation in the side bar. Project is the main entity and has a to-many relationship with File. It should look something like this: Project 1 > File1 File2 …
koen
  • 5,383
  • 7
  • 50
  • 89
1
vote
1 answer

NavigationSplitView works with .ID not with Object(struct)

In my project I want to navigate to the detail View in a NavigationSplitView. This however does not work, nothing happens. When I change the selection to the ID property all of it works. I made a very simple example view that demonstrates this (real…
DeveloperSammy
  • 167
  • 1
  • 11
1
vote
1 answer

NavigationLink selected state area is larger than the underlying view

I'm using a NavigationSplitView with two columns for a macOS app. The sidebar column shows a list of items and the right pane shows the details for the selected item. I'm using NavigationLink to create clickable sidebar items and pass my own…
1
vote
0 answers

NavigationSplitView navigates to last selected item when leaving edit mode

I have a NavigationSplitView and an EditButton in the same ContentView. Both do what they should, except that when I click "Edit" and then "Done", the detail view of the last selected item in my list appears. This happens only after I have clicked…
1
vote
1 answer

SwiftUI - Unable to navigate to next View from List/NavigationLink with navigationDestination

My first View represents a login screen, which then takes you to the home View. I've read through the documentation and watched WWDC22 - The SwiftUI cookbook for navigation which got me on the right track, but I'm unable to navigate past the home…
1
vote
1 answer

Where does the navigation destination go in an iOS 16 NavigationSplitView?

I've found this great video from Sean Allen https://www.youtube.com/watch?v=oxp8Qqwr4AY on having two different structs in a NavigationStack, but I cannot figure out how to make this work if I am using a NavigationSplitView. This is the code, which…
Rillieux
  • 587
  • 9
  • 23
0
votes
0 answers

How to avoid hard-coding navigation in a SwiftUI app using NavigationSplitView, NavigationStack, and NavigationPath

I'm trying to design an extensible navigation system using NavigationSplitView, NavigationStack, and NavigationPath. Definition of a route: struct Route: Identifiable, Hashable { let id: String let hashValue: Int let title: String …
Scott McKenzie
  • 16,052
  • 8
  • 45
  • 70
0
votes
1 answer

onDelete Does not Reliably Delete List Items in SwiftData NavigationSplitView

I'm building a new version of an app with SwiftData and am having issues with list deletions in iPad landscape mode. When deleting items, the deleted item randomly reappears as though not deleted from the context. I have included code for a very…
JohnSF
  • 3,736
  • 3
  • 36
  • 72
0
votes
1 answer

Does anybody have a working NavigationSplitView with NavigationStack in Details View?

No matter how it is set up, a complex 3 Columns NavigationSplitView with NavigationStack crashes or has inconsistent workflow. Sidebar selection determines which content (or feature) is in Content. Content (or feature) who is live (or selected)…
0
votes
1 answer

How to perform nested navigation in visionOS

I'm displaying a simple NavigationStack with some options, which navigate to a component with a NavigationView that looks something like this: NavigationView { List(courseMetadata.lessons, selection: $selection) { lesson in …
0
votes
0 answers

NavigationSplitView run time error when collapse and expand Sections

The code I test is the following. ContentView: import SwiftUI let dataSourceSection1 = [Folder(id: 1, name: "Folder1"), Folder(id: 2, name: "Folder2")] let dataSourceSection2 = [Folder(id: 3, name: "Folde3"), Folder(id: 4, name: "Folder4")] struct…
0
votes
1 answer

Programatic navigation on NavigationSplitView in SwiftUI

I have an app originally designed for iPad using NavigationSplitView. On a phone, I want it to automatically navigate to the detail view under certain circumstances. I have found the isActive property of NavigationLink, but this only works with…
Steve Schwedt
  • 380
  • 2
  • 11