I am using the Partial sheet library
My particular use case is using PartialSheet to display a view where a user is adding something to a list (in the main view underneath the sheet), when they press the add button on the sheet, a new confimation message needs to be rendered in the sheet view, before the user then returns to the main view.
The issue I am facing is when I update my state inside this sheet view, the state is being updated but my PartialSheet does not seem to re render.
My theory is that this is simply an isue with the library as the PartialSheet is attached to the main view so doesnt get this Views state changes. However, I wondered if I am missing something and can solve this issue. I've created a simple View to display this scenario and have attached a gif of the view in action.
Here is the code
import SwiftUI
import PartialSheet
struct AnotherContentView: View {
// @State var isConfirmSheetShown = false
@EnvironmentObject var partialSheet : PartialSheetManager
@State private var isTriggered = false
var body: some View {
VStack{
Text(isTriggered == true ? "Trigerred" : "Not triggered")
Button(action: {
self.partialSheet.showPartialSheet({
print("dismissed")
}) {
VStack() {
Text(isTriggered == true ? "Trigerred" : "Not triggered")
Button(action: {
isTriggered.toggle()
},label:{Text("Trigger state change")})
.padding(.top, 16.0)
}}
}, label: {
Text("Display the ViewModifier sheet")
})
}
}
}
Here is a video of the view in action
https://i.imgur.com/2JG6scR.mp4