re: How to Present and Dismiss a Modal in SwiftUI VIEW POST

re: For me, I can only present the sheet once when dismissing with the button. If I try to present it again it does nothing, but if I drag to dismiss I...

I'm running this on a device and in the Xcode simulator, and I'm not experiencing this. Any chance you have a link or some code to look at?

Are you running Catalina? I did have the issue you are reporting with the Catalina betas sometimes, but every time I ran on a real device it worked.


Well, after some more testing, it works as expected unless I am using a button in navigation bar trailing items. For some reason the problem I described only happens when it's a navigation bar button. If I just put a button somewhere else in the View it works perfectly. This solves my problem for now. Thanks for the reply, and for the tutorial!

And yes I am running Catalina, still on a beta so I'll try again when I am on the real Catalina/Xcode.

I also had this problem in the simulator at some point in the beta process, but when on a real device it works.
In my app on the App Store, I have this implemented as a nav bar button and it works as expected. You can see the code on my GitHub. I linked to the direct file.

code of conduct - report abuse