Contents

Bundle.DidLoadMessage

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

Declaration

struct DidLoadMessage

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

See Also

Getting classes from a bundle