---
title: load()
framework: objectivec
role: symbol
role_heading: Type Method
path: objectivec/nsobject-swift.class/load()
---

# load()

Invoked whenever a class or category is added to the Objective-C runtime; implement this method to perform class-specific behavior upon loading.

## Declaration

```swift
class func load()
```

## Discussion

Discussion The load() message is sent to classes and categories that are both dynamically loaded and statically linked, but only if the newly loaded class or category implements a method that can respond. The order of initialization is as follows: All initializers in any framework you link to. All +load methods in your image. All C++ static initializers and C/C++ __attribute__(constructor) functions in your image. All initializers in frameworks that link to you. In addition: A class’s +load method is called after all of its superclasses’ +load methods. A category +load method is called after the class’s own +load method. In a custom implementation of load() you can therefore safely message other unrelated classes from the same image, but any load() methods implemented by those classes may not have run yet. important: Custom implementations of the load method for Swift classes bridged to Objective-C are not called automatically.

## See Also

### Initializing a Class

- [initialize()](objectivec/nsobject-swift.class/initialize().md)
