Skip to content

Instantly share code, notes, and snippets.

@brunocastello
Created June 5, 2023 22:57
Show Gist options
  • Save brunocastello/677b5aa45f19082383903c9399373f48 to your computer and use it in GitHub Desktop.
Save brunocastello/677b5aa45f19082383903c9399373f48 to your computer and use it in GitHub Desktop.
New SwiftUI Inspector code
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