I have a parent view covering the entire screen that has a .fullScreenCover
. That parent view contains several child views with all the details of the 'page'. One of those child views contains an element that also has a .fullScreenCover
control.
struct ParentView: View {
@State var isPresent = false
var body: some View {
VStack {
// Other children
ChildView()
}.fullScreenCover(isPresent: self.$isPresent) {
CoverView()
}
}
}
struct ChildView: View {
@State var isPresent = false
var body: some View {
Button("Hello", action: { self.isPresent = true })
.fullScreenView(isPresent: self.$isPresent) {
ChildCoverView()
}
}
}
The screen cover for the parent view opens as expected, but when I try to open the screen cover from the child view, nothing happens. If I remove the .fullScreenCover
control from the parent view, then the child screen view does work, so it must have something to do with the nesting and all.
Is there a way to get a child .fullScreenCover
to work inside a parent view that also has a .fullScreenCover
?