I noticed that you can only have a single .popover
modifier in SwiftUI. I have to present two possible simple popovers, one of them a MenuView
, the other a CreateChannelView
.
For that I have:
@State private var popover: some View
@State private var showPopover = false
and then the modifier:
.popover(isPresented: self.$showPopover) {
self.popover
}
The problem is that I don't see how can I assign instances of MenuView
or CreateChannelView
to popover
as I get the error:
Cannot assign value of type 'MenuView' to type 'some View'
This is a little bit different than this question which passes generic views in the init
method.