<!--
{
  "availability" : [
    "iOS: 26.0.0 -",
    "iPadOS: 26.0.0 -",
    "macCatalyst: 26.0.0 -",
    "macOS: 26.0.0 -",
    "tvOS: 26.0.0 -",
    "visionOS: 26.0.0 -",
    "watchOS: 26.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Foundation",
  "identifier" : "/documentation/Foundation/NotificationCenter/MainActorMessage/makeMessage(_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Type Method",
  "symbol" : {
    "kind" : "Type Method",
    "modules" : [
      "Foundation"
    ],
    "preciseIdentifier" : "s:So20NSNotificationCenterC10FoundationE16MainActorMessageP04makeF0yxSgAC12NotificationVFZ"
  },
  "title" : "makeMessage(_:)"
}
-->

# makeMessage(_:)

Converts a posted notification into this main actor message type for any observers.

```
@MainActor static func makeMessage(_ notification: Notification) -> Self?
```

## Parameters

`notification`

The posted [`Notification`](/documentation/Foundation/Notification).

## Return Value

The converted `MainActorMessage` or `nil` if conversion is not possible.

## Discussion

To implement this method in your own `MainActorMessage` conformance, retrieve values from the [`Notification`](/documentation/Foundation/Notification)’s [`userInfo`](/documentation/Foundation/Notification/userInfo) and set them as properties on the message.

---

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)