Just wondering --- as of 2020 --- if there is a built-in way in the SwiftUI package to enhance the "swipe to dismiss" gesture on Sheets.
I've been to this question here: Prevent dismissal of modal view controller in SwiftUI --- doesn't work (at least not anymore) and Xcode doesn't suggest a fix/migration on the code provided in the upvoted answer.
Also been to a few other posts, but they either point to the linked answer above, or suggest 3rd party packages. (I'm trying to avoid those because SwiftUI is rapidly evolving and better stick to what Apple officially provides for now.)
So to sum, is there a way to ---
- Prevent users from dismissing a
Sheet
(not aFullScreenCover
) by swiping down - Optionally present an alert or do any other thing, like when you go to Calendar.app, create an event, type a few letters and try to dismiss it
- ... All without using 3rd party libraries?
Thanks.