Reading time: 2 min
This recipe shows how to present a custom view modally from anywhere in the SwiftUI app. Normally, presenting a view on top of another one forces you do define the transition in the parent view. This solution, however, makes it so that the segue is defined in just a single place and is always presented on top of current view.
Search our recipes
Check out the companion apps!
Our free companion app and XCode Extension brings 100+ SwiftUI recipes right at your fingertips! Get a preview of it in the Online Companion.
Have a recipe for us?
Get in touch and let's grow the cookbook together!