Questions tagged [swiftui-navigationsplitview]
45 questions
0
votes
0 answers
Path of NavigationStack inside NavigationSplitView emptied on change
I have the following view inside WindowGroup:
struct SidebarSelection: View {
@State var selection: Int?
@State var path: [Int] = []
var body: some View {
NavigationSplitView {
List(1...20, id: \.self,…

Dominik
- 706
- 7
- 22
0
votes
1 answer
SwiftUI TextField mysteriously breaks navigation animation when used with NavigationPath
MRE
enum HomeDestination: Int, CaseIterable, Hashable, Identifiable {
case a
var id: Int { rawValue }
var name: String {
switch self {
case .a: return "A"
}
}
}
class NavCordinator: ObservableObject {
…

erotsppa
- 14,248
- 33
- 123
- 181
0
votes
1 answer
SwiftUI when pushing to a view with a ScrollView the NavigationBar collapses from LargeTitle to Inline in a jerky manner
I have created the following project to demonstrate this issue. When I push to another view that contains a scrollView (List in this case) and a navigationTitle is defined, the navigationBar goes from LargeTitle to inline in a jerky manner. …

alionthego
- 8,508
- 9
- 52
- 125
0
votes
1 answer
How to prevent SwiftUI DetailView from crashing when deleting the last entity from CoreData collection?
I have a CoreData entity called TestItem:
If there's 1 entity in collection, deleting this entity will crash the app with an error: "Thread 1: EXC_BREAKPOINT (code=1, subcode=0x197c0b8b4)". As it seems, nothing will prevent DetailView from crashing…

netsplatter
- 559
- 3
- 14
0
votes
0 answers
NavigationSplitView trouble passing title to Detail View
I'm having trouble setting up a NavigationSplit view and passing details to NavigationTitle of the Detail view.
Here's my basic View setup
struct SplitView: View {
private let folder = xFolder.folderList
@State var selectedFolder:…

Pam
- 121
- 3
0
votes
0 answers
NavigationSplitView detail not updating
Why does the button "Show second view" not work here?
struct ContentView: View {
@State private var showSecondView = false
var body: some View {
NavigationSplitView {
// Sidebar content irrelevant
} detail:…

John
- 964
- 8
- 21
0
votes
0 answers
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 content irrelevant
} detail: {
Text("Above…

John
- 964
- 8
- 21
0
votes
0 answers
SwiftUI TabView NavigationSplitView
I have a TabView with four tabitems which destinations are four NavigationSplitView. The Sidebar button is repeating for the four NavigationSplitViews on macOS like on below display. On iPad it works properly. How to fix the Sidebar button to…

JYF97411
- 1
- 1
0
votes
1 answer
NavigationSplitView not updating
Can someone please help me why the NavigationLink is not working as intended?
As shown down below (in the code) I use the MarkdownWebView(url: ) with 3 different URL’s.
But when I want to switch between them, the view doesn’t update.
If I open…

luegm.dev
- 81
- 8
0
votes
1 answer
How to unmute colors in SwiftUI's NavigationSplitView sidebar
I am using NavigationSplitView, introduced in iOS16, with a basic list and attempting to color a system image with standard colors. I am noticing that when the navigationSplitViewStyle is .automatic or .prominentDetail and the color scheme is dark,…

stanlemon
- 399
- 3
- 10
0
votes
1 answer
Footer of section of list shown as a sidebar panel in NavigationSplitView is missing
I am dabbling with the NavigationSplitView introduced this year.
I have a funny behaviour when I use a list with several sections in the side panel, where the sections have footers: those footers are not displayed at all, but only when used in the…

appfrosch
- 1,146
- 13
- 36
0
votes
1 answer
Saving the current width of a NavigationSplitView sidebar in SwiftUI
I'm making a macOS app in SwiftUI with the new NavigationSplitView. If a user resizes the sidebar, I'd like that new width to be remembered and restored when the app next loads.
A preference can be read in like so...
@State private var width =…

Ian
- 45
- 4
0
votes
1 answer
Is it possible to start the NavigationSplitView in an expanded state on macOS using SwiftUI?
I like the sidebar to be opened at launch.
However when I build and run the app, this is what I get.
So I need to click on the sidebar icon to show it. This is not the behavior I want. Is it possible to change this?

Mark
- 16,906
- 20
- 84
- 117
0
votes
1 answer
SwiftUI NavigationSplitView - reset Detail view when Sidebar selection changes
In iOS 16, I have a 3-column Sidebar-Content-Detail view. When the Sidebar selection changes, I would like to refresh (clear) the detail view.
var body: some View {
NavigationSplitView {
List(Content.allCases, selection:…

coco
- 2,998
- 1
- 35
- 58
-1
votes
1 answer
SwiftUI 4: How to not expose internal views when using NavigationStack?
Suppose I'm working on a calendar library in SwiftUI 4. The calendar has a button for user to select a month. When user clicks on that button, it navigates to a view which lists all the months for user to select. The key setup here is the calendar…

rayx
- 1,329
- 10
- 23