Created
August 29, 2021 10:48
-
-
Save kuotinyen/31d3cf5a9f5f0ad9cbb7a76b7a08ed19 to your computer and use it in GitHub Desktop.
ToolbarDemoView.swift
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
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