Framework

Message​UI

Create a user interface for composing email and text messages, so users can edit and send messages without leaving your app.

Overview

The Message UI framework provides specialized view controllers for presenting standard composition interfaces for email and SMS (Short Messaging Service) text messages. Use these interfaces to add message delivery capabilities without requiring the user to leave your app.

To display a composition interface, present the corresponding view controller modally from your app. Once presented, the user has the option to customize the contents before sending or canceling the message. Your custom delegate object then handles the dismissal of the view controller based on the user’s action. For information on how to present and dismiss view controllers, see View Controller Programming Guide for iOS.

Symbols

Classes

MFMail​Compose​View​Controller

The MFMail​Compose​View​Controller class provides a standard interface for managing, editing, and sending an email message. Use this view controller to display a standard email interface inside your app. Before presenting the interface, populate the fields with initial values for the subject, email recipients, body text, and attachments of the email. After presenting the interface, the user can edit your initial values before sending the email.

MFMessage​Compose​View​Controller

Provides a standard interface for composing and sending SMS or MMS messages.

Protocols

MFMail​Compose​View​Controller​Delegate

The MFMail​Compose​View​Controller​Delegate 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.

MFMessage​Compose​View​Controller​Delegate

The MFMessage​Compose​View​Controller​Delegate protocol defines a single method that custom objects can implement to respond to updates from a message composition view (an instance of the MFMessage​Compose​View​Controller class). Use the method of this protocol to respond to the end of the user composing an SMS message. The method includes information about whether the user chose to send or cancel the message or whether the attempt to send it failed.

Extended Types

MFMail​Compose​Error
NSNotification.Name

The type used for the name of a notification.