On my quest to replicate Apple’s Reminders app using just pure SwiftUI and Firebase, I spent some time this week to implement a confirmation dialog for Make It So. The idea is to prevent the user from accidentally losing any changes when they leave the edit dialog for a reminder. What seemed like something you might be able to implement in an hour or so ended up being a lot more complex than I would’ve thought in the beginning. Along the way, I discovered a couple of interesting things:
actionSheet is deprecated in iOS 15, and has been superseded by
- You can now prevent the user from dismissing a sheet by using the new
interactiveDismissDisabled view modifier.
- Unfortunately, this view modifier lacks one crucial feature.
In the article, I go into more detail how to build a reusable solution for adding confirmation dialogs to your edit dialogs. I also implement a better version of
interactiveDismissDisabled, but then I go on to tell you not to use it. Why? Read the article to find out!