Instance Method


Tells the delegate that the user wants to dismiss the mail composition view.


optional func mailComposeController(_ controller: MFMailComposeViewController, didFinishWith result: MFMailComposeResult, error: Error?)



The view controller object that manages the mail composition view.


The result of the user’s action.


If an error occurred, this parameter contains an error object with information about the type of failure.


Your implementation of this method should dismiss the mail composition view. Implementation of this method is optional, but expected.

If the user has opted to send the email created by this interface, that email should be queued in the user’s Mail program by the time this method is called. If an error occurred while queueing the email message, the error parameter contains an error object that indicates the type of failure that occurred.

See Also

Responding to Email Completion

enum MFMailComposeResult

Result codes returned when the mail composition interface is dismissed.