An interface for responding to user interactions with a mail compose view controller.


protocol MFMailComposeViewControllerDelegate


The MFMailComposeViewControllerDelegate protocol defines the method that your delegate must implement to manage the mail composition interface. The method of this protocol notifies your delegate object when the user has finished with the interface and is ready to dismiss it.

Your delegate object is responsible for dismissing the picker when the operation completes. You do this by using the dismissModalViewController(animated:) method of the parent view controller, which is responsible for displaying the MFMailComposeViewController object’s interface.


Responding to Email Completion

func mailComposeController(MFMailComposeViewController, didFinishWith: MFMailComposeResult, error: Error?)

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

enum MFMailComposeResult

Result codes returned when the mail composition interface is dismissed.


Inherits From

See Also

Responding to the View Controller Dismissal

var mailComposeDelegate: MFMailComposeViewControllerDelegate?

The mail composition view controller’s delegate.