Open IAMTHEBURT opened 1 year ago
I am also experiencing the exact same issue.
I confirmed that the @Published
variable was getting updated by adding a didSet {}
property observer.
Also confirmed that using a local @State
variable works as @IAMTHEBURT mentioned.
This seems like such a typical use case that I'm also wondering if I'm missing something here.
I'm having difficulty triggering a partial sheet from a @Published variable within my ViewModel. However, the same partial sheet triggers as expected when using a @State variable within the View. Here is the code snippet that is not working as expected:
When tapping the "globe" image, the partial sheet is not triggered, despite vm.isPresented being toggled.
Expected Behavior:
I expect the partial sheet to be presented when the @Published variable isPresented is toggled in the ViewModel.
Actual Behavior:
The partial sheet is not being presented when the @Published variable isPresented is toggled in the ViewModel.
Could you please help me understand why this is happening? Is this a bug or am I missing something?