Created
June 5, 2023 22:57
-
-
Save brunocastello/677b5aa45f19082383903c9399373f48 to your computer and use it in GitHub Desktop.
New SwiftUI Inspector code
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
struct ContentView: View { | |
@State var showInspector = false | |
var body: some View { | |
NavigationSplitView { | |
Text("Hello") | |
} detail: { | |
VStack { | |
Image(systemName: "globe") | |
.imageScale(.large) | |
.foregroundStyle(.tint) | |
Text("Hello, world!") | |
Toggle("Show inspector", isOn: $showInspector) | |
} | |
.padding() | |
.inspector(isPresented: $showInspector) { | |
Text("Hello") | |
.toolbar { | |
Button("Test") { | |
} | |
} | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment