---
title: Bundle.DidLoadMessage
framework: foundation
role: symbol
role_heading: Structure
path: foundation/bundle/didloadmessage
---

# Bundle.DidLoadMessage

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

## Declaration

```swift
struct DidLoadMessage
```

## Overview

Overview When a bundle handles a request to load a class with classNamed(_:) or  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, or specify its type directly to the addObserver(of:for:using:) method. The Subject of this message type is Bundle. This message interoperates with the notification didLoadNotification. The system notifies observers of the message when the NotificationCenter posts the notification. Similarly, the system notifies observers of the notification when it posts the message.

## Topics

### Creating a message

- [init()](foundation/bundle/didloadmessage/init().md)

## Relationships

### Conforms To

- [NotificationCenter.AsyncMessage](foundation/notificationcenter/asyncmessage.md)
- [Sendable](swift/sendable.md)
- [SendableMetatype](swift/sendablemetatype.md)

## See Also

### Getting classes from a bundle

- [classNamed(_:)](foundation/bundle/classnamed(_:).md)
- [principalClass](foundation/bundle/principalclass.md)
- [didLoadNotification](foundation/bundle/didloadnotification.md)
- [NSLoadedClasses](foundation/nsloadedclasses.md)
