Class

MSMessagesAppViewController

The MSMessagesAppViewController class acts as the principal view controller for Messages extensions. Use this class to manage your extension. For more information on app extensions, see App Extension Programming Guide.

Topics

Managing the Extension’s State

var activeConversation: MSConversation?

The conversation currently displayed in the transcript.

func dismiss()

Dismisses the extension and marks it for termination.

func willBecomeActive(with: MSConversation)

Invoked just before the Messages extension becomes active.

func didBecomeActive(with: MSConversation)

Invoked after the Messages extension becomes active.

func willResignActive(with: MSConversation)

Invoked just before the message resigns its active status.

func didResignActive(with: MSConversation)

Invoked after the message resigns its active status.

Tracking Messages

func willSelect(MSMessage, conversation: MSConversation)

Invoked after the user selects a message object in the transcript, but before the system updates the conversation’s selectedMessage property.

func didSelect(MSMessage, conversation: MSConversation)

Invoked after the system updates the conversation’s selectedMessage property in response to the user selecting a message object in the transcript.

func didReceive(MSMessage, conversation: MSConversation)

Invoked when the Messages extension receives a new message object.

func didStartSending(MSMessage, conversation: MSConversation)

Invoked when the user sends a message object.

func didCancelSending(MSMessage, conversation: MSConversation)

Invoked when the user deletes a message object from the Messages app’s input field.

Working with Presentation Styles

var presentationStyle: MSMessagesAppPresentationStyle

The extension’s current presentation style.

func requestPresentationStyle(MSMessagesAppPresentationStyle)

Asks the extension’s user interface to transition to the provided style.

func willTransition(to: MSMessagesAppPresentationStyle)

Tells the view controller that the extension is about to transition to a new presentation style.

func didTransition(to: MSMessagesAppPresentationStyle)

Tells the view controller that the extension has transitioned to a new presentation style.

Constants

enum MSMessagesAppPresentationStyle

Presentation styles describing the extension’s appearance in the Messages app.