Created
January 8, 2026 19:20
-
-
Save dmdeller/9a5518c02e5e6ac8027ce916520c5c0e to your computer and use it in GitHub Desktop.
SwiftUI Tahoe sidebar problems
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import SwiftUI | |
| struct ContentView: View { | |
| var body: some View { | |
| splitView | |
| } | |
| @ViewBuilder | |
| var splitView: some View { | |
| NavigationSplitView { | |
| sidebar | |
| } detail: { | |
| helloWorld | |
| } | |
| } | |
| @ViewBuilder | |
| var sidebar: some View { | |
| List { | |
| NavigationLink { | |
| helloWorld | |
| } label: { | |
| Label("Test", systemImage: "book") | |
| } | |
| NavigationLink { | |
| helloWorld | |
| } label: { | |
| Label("Test 2", systemImage: "folder") | |
| } | |
| NavigationLink { | |
| helloWorld | |
| } label: { | |
| Label("Test 3", systemImage: "house") | |
| } | |
| DisclosureGroup( | |
| content: { | |
| NavigationLink { | |
| helloWorld | |
| } label: { | |
| Label("Test", systemImage: "book") | |
| } | |
| NavigationLink { | |
| helloWorld | |
| } label: { | |
| Label("Test 2", systemImage: "folder") | |
| } | |
| NavigationLink { | |
| helloWorld | |
| } label: { | |
| Label("Test 3", systemImage: "house") | |
| } | |
| }, | |
| label: { | |
| Label("Test 4", systemImage: "document") | |
| } | |
| ) | |
| } | |
| } | |
| @ViewBuilder | |
| var helloWorld: some View { | |
| VStack { | |
| Image(systemName: "globe") | |
| .imageScale(.large) | |
| .foregroundStyle(.tint) | |
| Text("Hello, world!") | |
| } | |
| .padding() | |
| } | |
| } | |
| #Preview { | |
| ContentView() | |
| } |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Icons are wrong size compared to built-in Tahoe apps.