---
title: mailComposeDelegate
framework: Message UI
role: symbol
role_heading: Instance Property
platforms: [iOS 3.0+, iPadOS 3.0+, Mac Catalyst 13.1+, visionOS 1.0+]
path: messageui/mfmailcomposeviewcontroller/mailcomposedelegate
---

# mailComposeDelegate

The mail composition view controller’s delegate.

## Declaration

```swift
weak var mailComposeDelegate: (any MFMailComposeViewControllerDelegate)? { get set }
```

## Discussion

Discussion The delegate object is responsible for dismissing the view presented by this view controller at the appropriate time. Therefore, you should always provide a delegate, and that object should implement the methods of the MFMailComposeViewControllerDelegate protocol.

## See Also

### Responding to the view controller dismissal

- [MFMailComposeViewControllerDelegate](messageui/mfmailcomposeviewcontrollerdelegate.md)
