How to present a modal view with Sheet in SwiftUI

A modal view is known as a Sheet in SwiftUI. You can use the method on views to open up a sheet on top of the view it’s attached on by passing in a boolean variable binding, optionally a closure to run when dismissed and the view to show in the modal.

Published by Paul Young-Suk Lee

SWE @lyft. Currently working on data infrastructure

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: