<!--
{
  "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/Bundle/DidLoadMessage",
  "metadataVersion" : "0.1.0",
  "role" : "Structure",
  "symbol" : {
    "kind" : "Structure",
    "modules" : [
      "Foundation"
    ],
    "preciseIdentifier" : "s:So8NSBundleC10FoundationE14DidLoadMessageV"
  },
  "title" : "Bundle.DidLoadMessage"
}
-->

# Bundle.DidLoadMessage

A message a bundle sends when it dynamically loads a class.

```
struct DidLoadMessage
```

## Overview

When a bundle handles a request to load a class with [`classNamed(_:)`](/documentation/Foundation/Bundle/classNamed(_:)) or  [`principalClass`](/documentation/Foundation/Bundle/principalClass), the bundle dynamically loads the executable code file that contains the class implementation and all other class definitions contained in the file.
After module loading completes, the bundle posts this message.

Observe this message with the identifier [`didLoad`](/documentation/Foundation/NotificationCenter/MessageIdentifier/didLoad), or specify its type directly to the `addObserver(of:for:using:)` method.
The [`Subject`](/documentation/Foundation/NotificationCenter/MainActorMessage/Subject) of this message type is [`Bundle`](/documentation/Foundation/Bundle).

This message interoperates with the notification [`didLoadNotification`](/documentation/Foundation/Bundle/didLoadNotification).
The system notifies observers of the message when the [`NotificationCenter`](/documentation/Foundation/NotificationCenter) posts the notification.
Similarly, the system notifies observers of the notification when it posts the message.

## Topics

### Creating a message

[`init()`](/documentation/Foundation/Bundle/DidLoadMessage/init())

Creates a message that indicates a bundle dynamically loaded a class.

## Relationships

### Conforms To

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

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

[`AsyncMessage`](/documentation/Foundation/NotificationCenter/AsyncMessage)

---

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)