<!--
{
  "availability" : [
    "iOS: 3.0.0 -",
    "iPadOS: 3.0.0 -",
    "macCatalyst: 13.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "MessageUI",
  "identifier" : "/documentation/MessageUI/MFMailComposeViewControllerDelegate",
  "metadataVersion" : "0.1.0",
  "role" : "Protocol",
  "symbol" : {
    "kind" : "Protocol",
    "modules" : [
      "Message UI"
    ],
    "preciseIdentifier" : "c:objc(pl)MFMailComposeViewControllerDelegate"
  },
  "title" : "MFMailComposeViewControllerDelegate"
}
-->

# MFMailComposeViewControllerDelegate

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

```
protocol MFMailComposeViewControllerDelegate : NSObjectProtocol
```

## Overview

The [`MFMailComposeViewControllerDelegate`](/documentation/MessageUI/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 <doc://com.apple.documentation/documentation/UIKit/UIViewController/dismiss(animated:completion:)> method of the parent view controller, which is responsible for displaying the [`MFMailComposeViewController`](/documentation/MessageUI/MFMailComposeViewController) object’s interface.

## Topics

### Responding to Email Completion

[`-  mailComposeController:didFinishWithResult:error:`](/documentation/MessageUI/MFMailComposeViewControllerDelegate/mailComposeController(_:didFinishWith:error:))

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

[`MFMailComposeResult`](/documentation/MessageUI/MFMailComposeResult)

Result codes returned when the mail composition interface is dismissed.

## Relationships

### Inherits From

[`NSObjectProtocol`](/documentation/ObjectiveC/NSObjectProtocol)

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)