---
title: selectedMessage
framework: messages
role: symbol
role_heading: Instance Property
path: messages/msconversation/selectedmessage
---

# selectedMessage

The message that the user selected in the conversation transcript.

## Declaration

```swift
var selectedMessage: MSMessage? { get }
```

## Discussion

Discussion If the user selected one of your extension’s messages in the conversation transcript, this property is set to the selected message object. Otherwise, it is set to nil. If your extension was launched because the user selected the message, then this property is set when the extension is launched. If the user selects a message while your extension is running, the system takes the following steps: Invokes your MSMessagesAppViewController object’s willSelect(_:conversation:) method. Updates the conversation’s selectedMessage property. Invokes your MSMessagesAppViewController object’s didSelect(_:conversation:) method. Override willSelect(_:conversation:) or didSelect(_:conversation:) to handle changes to the selected message while your extension is active. note: This property is always set to the message object selected by the user. If this message belongs to a session, then the selected message might not contain the most current data. The selected message is not updated when you receive new messages. Instead, override your view controller’s didReceive(_:conversation:) message to handle updates.
