---
title: "objc_disposeClassPair(_:)"
framework: Objective-C Runtime
role: symbol
role_heading: Function
platforms: [iOS 2.0+, iPadOS 2.0+, Mac Catalyst 13.1+, macOS 10.5+, tvOS 9.0+, visionOS 1.0+, watchOS 1.0+]
path: "objectivec/objc_disposeclasspair(_:)"
---

# objc_disposeClassPair(_:)

Destroys a class and its associated metaclass.

## Declaration

```swift
func objc_disposeClassPair(_ cls: AnyClass)
```

## Parameters

- `cls`: The class to be destroyed. This class must have been allocated using doc://com.apple.objectivec/documentation/ObjectiveC/objc_allocateClassPair(_:_:_:).

## Discussion

Discussion Do not call this function if instances of the cls class or any subclass exist.

## See Also

### Adding Classes

- [objc_allocateClassPair(_:_:_:)](objectivec/objc_allocateclasspair(_:_:_:).md)
- [objc_registerClassPair(_:)](objectivec/objc_registerclasspair(_:).md)
- [objc_duplicateClass(_:_:_:)](objectivec/objc_duplicateclass(_:_:_:).md)
