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

# MSMessage

A custom message object.

```
class MSMessage
```

## Overview

Use the [`MSMessage`](/documentation/Messages/MSMessage) class to create custom message objects. To create interactive messages that can be updated by the conversation’s participants, instantiate a message with a session using the [`init(session:)`](/documentation/Messages/MSMessage/init(session:)) method. Otherwise, instantiate the message using the [`init()`](/documentation/Messages/MSMessage/init()) method.

## Topics

### Creating Messages

[`init()`](/documentation/Messages/MSMessage/init())

Initializes a new message that is not part of a session.

[`init(session: MSSession)`](/documentation/Messages/MSMessage/init(session:))

Initializes a new message that is part of the provided session.

### Message Properties

[`var accessibilityLabel: String?`](/documentation/Messages/MSMessage/accessibilityLabel)

A localized string that describes the message.

[`var error: (any Error)?`](/documentation/Messages/MSMessage/error)

An error object describing why the system failed to send the message.

[`var isPending: Bool`](/documentation/Messages/MSMessage/isPending)

A Boolean value that indicates whether the message is pending or whether it has been sent or received.

[`var layout: MSMessageLayout?`](/documentation/Messages/MSMessage/layout)

A layout object that defines the message’s appearance.

[`var senderParticipantIdentifier: UUID`](/documentation/Messages/MSMessage/senderParticipantIdentifier)

A UUID identifying the participant that sent the message.

[`var session: MSSession?`](/documentation/Messages/MSMessage/session)

The session that this message belongs to.

[`var shouldExpire: Bool`](/documentation/Messages/MSMessage/shouldExpire)

A Boolean value that determines whether the message should expire after being read.

[`var summaryText: String?`](/documentation/Messages/MSMessage/summaryText)

A succinct description of the message.

[`var url: URL?`](/documentation/Messages/MSMessage/url)

A URL that encodes data to be transmitted with the message.

### Initializers

[`init?(coder: NSCoder)`](/documentation/Messages/MSMessage/init(coder:))

## Relationships

### Conforms To

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

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

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

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

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

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

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

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

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

### Inherits From

[`NSObject-swift.class`](/documentation/ObjectiveC/NSObject-swift.class)

---

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)