Skip to content
Discussion options

You must be logged in to vote

Okay. I managed to get it working by handling the confirmation dialog actions differently. When the user selects Delete from the confirmation dialog I set its state to nil immediately and then send the .deleteConfirmed action to the parent reducer.

As for navigation I resorted to doing a manual dismiss of the detail view using a method @mbrandonw described here:
https://forums.swift.org/t/programatic-dismiss-navigation-animation-based-on-state-binding/39275/7

Basically hold an isPresented bool in the state and then change that to false when appropriate. Watch for the change in an .onChange modifier like this:

@Environment(\.presentationMode) var presentationMode: Binding<PresentationMode>

.

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@mbrandonw
Comment options

@tylerjames
Comment options

Answer selected by tylerjames
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants