Skip to content

Instantly share code, notes, and snippets.

@kuotinyen
Created August 29, 2021 10:48
Show Gist options
  • Save kuotinyen/31d3cf5a9f5f0ad9cbb7a76b7a08ed19 to your computer and use it in GitHub Desktop.
Save kuotinyen/31d3cf5a9f5f0ad9cbb7a76b7a08ed19 to your computer and use it in GitHub Desktop.
ToolbarDemoView.swift
struct ToolbarDemoView: View {
@State var showDetail: Bool = false
var body: some View {
NavigationView {
ZStack {
Text("ToolbarDemoView")
}
.navigationTitle("Title")
.toolbar {
ToolbarItem(placement: .navigationBarLeading) {
Button {
// no-op
showDetail = true
} label: {
Image(systemName: "line.horizontal.3.decrease.circle")
.resizable()
}
}
}
.sheet(isPresented: $showDetail) {
Text("Detail Demo")
}
}
}
}
struct ToolbarDemoView_Previews: PreviewProvider {
static var previews: some View {
ToolbarDemoView()
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment