Issue #765
In SwiftUI currently, it’s not possible to attach multiple .popover
to the same View. But we can use condition to show different content
struct ClipboardCell: View {
enum PopoverStyle {
case raw
case preview
}
@Binding
var showsPopover: Bool
@Binding
var popoverStyle: PopoverStyle
var body: some View {
VStack {
header
content
.popover(isPresented: $showsPopover) {
switch popoverStyle {
case .raw:
ViewRawView(item: item)
case .preview:
PreviewView(item: item)
}
}
footer
}
}
}