Post #2694471
2026-05-14 14:48 UTC
Is there a way in #SwiftUI to detect when a sheet is being dismissed by a user to present a confirmationDialog in case of unsaved changes, as recommended by Apple HIG about Sheets?
In UIKit, we can use the presentationControllerDidAttemptToDismiss method.
Feebdack: FB22777840
Replies (1)
-
@appfrosch@iosdev.space 2026-05-15 05:58
@alpennec@iosdev.space would be nice if such a callback existed … One workaround could be to disable swipe to dismiss and introduce a cancel/save (or next or whatever) toolbar. Not always what one would probably want though 🤷