<!--
{
  "availability" : [
    "iOS: 10.0.0 -",
    "iPadOS: 10.0.0 -",
    "macCatalyst: 13.1.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Messages",
  "identifier" : "/documentation/Messages/MSMessagesAppViewController",
  "metadataVersion" : "0.1.0",
  "role" : "Class",
  "symbol" : {
    "kind" : "Class",
    "modules" : [
      "Messages"
    ],
    "preciseIdentifier" : "c:objc(cs)MSMessagesAppViewController"
  },
  "title" : "MSMessagesAppViewController"
}
-->

# MSMessagesAppViewController

The principal view controller for iMessage apps.

```
class MSMessagesAppViewController
```

## Overview

Use this class to manage your extension. For more information on app extensions, see [App Extension Programming Guide](https://developer.apple.com/library/archive/documentation/General/Conceptual/ExtensibilityPG/index.html#//apple_ref/doc/uid/TP40014214).

## Topics

### Managing the Extension’s State

[`activeConversation`](/documentation/Messages/MSMessagesAppViewController/activeConversation)

The conversation currently displayed in the transcript.

[`-  dismiss`](/documentation/Messages/MSMessagesAppViewController/dismiss())

Dismisses the extension and marks it for termination.

[`-  willBecomeActiveWithConversation:`](/documentation/Messages/MSMessagesAppViewController/willBecomeActive(with:))

Invoked just before the Messages extension becomes active.

[`-  didBecomeActiveWithConversation:`](/documentation/Messages/MSMessagesAppViewController/didBecomeActive(with:))

Invoked after the Messages extension becomes active.

[`-  willResignActiveWithConversation:`](/documentation/Messages/MSMessagesAppViewController/willResignActive(with:))

Invoked just before the message resigns its active status.

[`-  didResignActiveWithConversation:`](/documentation/Messages/MSMessagesAppViewController/didResignActive(with:))

Invoked after the message resigns its active status.

### Tracking Messages

[`-  willSelectMessage:conversation:`](/documentation/Messages/MSMessagesAppViewController/willSelect(_:conversation:))

Invoked in response to the user selecting a message object in the transcript, before the system updates the conversation’s [`selectedMessage`](/documentation/Messages/MSConversation/selectedMessage) property.

[`-  didSelectMessage:conversation:`](/documentation/Messages/MSMessagesAppViewController/didSelect(_:conversation:))

Invoked in response to the user selecting a message object in the transcript, after the system updates the conversation’s [`selectedMessage`](/documentation/Messages/MSConversation/selectedMessage) property.

[`-  didReceiveMessage:conversation:`](/documentation/Messages/MSMessagesAppViewController/didReceive(_:conversation:))

Invoked when the iMessage app receives a new message object.

[`-  didStartSendingMessage:conversation:`](/documentation/Messages/MSMessagesAppViewController/didStartSending(_:conversation:))

Invoked when the user sends a message object.

[`-  didCancelSendingMessage:conversation:`](/documentation/Messages/MSMessagesAppViewController/didCancelSending(_:conversation:))

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

### Working with Presentation Styles and Contexts

[`presentationStyle`](/documentation/Messages/MSMessagesAppViewController/presentationStyle)

The extension’s current presentation style.

[`-  requestPresentationStyle:`](/documentation/Messages/MSMessagesAppViewController/requestPresentationStyle(_:))

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

[`-  willTransitionToPresentationStyle:`](/documentation/Messages/MSMessagesAppViewController/willTransition(to:))

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

[`-  didTransitionToPresentationStyle:`](/documentation/Messages/MSMessagesAppViewController/didTransition(to:))

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

[`MSMessagesAppPresentationStyle`](/documentation/Messages/MSMessagesAppPresentationStyle)

Presentation styles that describe your iMessage app’s appearance.

[`presentationContext`](/documentation/Messages/MSMessagesAppViewController/presentationContext)

The context describing where your iMessage app is presented.

[`MSMessagesAppPresentationContext`](/documentation/Messages/MSMessagesAppPresentationContext)

Presentation contexts describing where your iMessage app appears.

## Relationships

### Conforms To

[`UIPasteConfigurationSupporting`](/documentation/UIKit/UIPasteConfigurationSupporting)

[`Equatable`](/documentation/Swift/Equatable)

[`SendableMetatype`](/documentation/Swift/SendableMetatype)

[`NSExtensionRequestHandling`](/documentation/Foundation/NSExtensionRequestHandling)

[`CustomStringConvertible`](/documentation/Swift/CustomStringConvertible)

[`Sendable`](/documentation/Swift/Sendable)

[`NSCoding`](/documentation/Foundation/NSCoding)

[`CVarArg`](/documentation/Swift/CVarArg)

[`UIAppearanceContainer`](/documentation/UIKit/UIAppearanceContainer)

[`Hashable`](/documentation/Swift/Hashable)

[`UIUserActivityRestoring`](/documentation/UIKit/UIUserActivityRestoring)

[`CustomDebugStringConvertible`](/documentation/Swift/CustomDebugStringConvertible)

[`UITraitEnvironment`](/documentation/UIKit/UITraitEnvironment)

[`UIResponderStandardEditActions`](/documentation/UIKit/UIResponderStandardEditActions)

[`MSMessagesAppTranscriptPresentation`](/documentation/Messages/MSMessagesAppTranscriptPresentation)

[`NSTouchBarProvider`](/documentation/AppKit/NSTouchBarProvider)

[`UIActivityItemsConfigurationProviding`](/documentation/UIKit/UIActivityItemsConfigurationProviding)

[`UIStateRestoring`](/documentation/UIKit/UIStateRestoring)

[`UIContentContainer`](/documentation/UIKit/UIContentContainer)

[`UIFocusEnvironment`](/documentation/UIKit/UIFocusEnvironment)

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

[`UITraitChangeObservable-67e94`](/documentation/UIKit/UITraitChangeObservable-67e94)

### Inherits From

[`UIViewController`](/documentation/UIKit/UIViewController)

---

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)