Skip to content

Instantly share code, notes, and snippets.

@tfedyanin
Last active February 9, 2020 19:43
Show Gist options
  • Save tfedyanin/d0691ebbcaddb2b4bef943d35e8ee202 to your computer and use it in GitHub Desktop.
Save tfedyanin/d0691ebbcaddb2b4bef943d35e8ee202 to your computer and use it in GitHub Desktop.
import SwiftUI
struct FullWidthImageView: View {
var body: some View {
VStack {
Image(systemName: "trash")
.resizable()
.aspectRatio(contentMode: .fit)
.frame(width: 200)
.contextMenu(ContextMenu {
Button("A") {}
Button("B") {}
})
Text("I don’t want to show in preview because I don’t have context menu modifire").bold()
}
}
}
struct ContentView: View {
var body: some View {
List {
FullWidthImageView()
FullWidthImageView()
}
}
}
struct ContentView_Previews: PreviewProvider {
static var previews: some View {
ContentView()
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment