Created
October 31, 2024 19:46
-
-
Save VAndrJ/ac7f0a5352774a29c687263e9221702d to your computer and use it in GitHub Desktop.
NavigationSplitView issue MRE.
This file contains 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 | |
@main | |
struct SplitMREApp: App { | |
var body: some Scene { | |
WindowGroup { | |
ContentView() | |
} | |
} | |
} | |
struct ContentView: View { | |
@State private var columnVisibility: NavigationSplitViewVisibility = .all | |
var body: some View { | |
NavigationSplitView(columnVisibility: $columnVisibility) { | |
Text("Side") | |
.toolbar { | |
ToolbarItem { | |
Text("Example") | |
} | |
ToolbarItem { | |
Button("Detail") { | |
columnVisibility = .detailOnly | |
} | |
} | |
} | |
} content: { | |
Text("Content") | |
} detail: { | |
Text("Detail") | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment