Skip to content

6. Perform Actions On Dismiss

Gabriel Theodoropoulos edited this page Jul 22, 2021 · 1 revision

Email composer is presented in a modal sheet, and sheets in SwiftUI have an optional closure to perform further actions upon dismissal. The onDismiss argument lets you do exactly that in the emailComposer modifier when the email composer gets dismissed.

.emailComposer(isPresented: $showEmailComposer,
               onDismiss: {
    // Do something when the email composer sheet is dismissed...
})

Clone this wiki locally