<!--
{
  "availability" : [
    "iOS: 2.0.0 -",
    "iPadOS: 2.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.0.0 -",
    "tvOS: 9.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "ObjectiveC",
  "identifier" : "/documentation/ObjectiveC/NSObject-swift.class/isSubclass(of:)",
  "metadataVersion" : "0.1.0",
  "role" : "Type Method",
  "symbol" : {
    "kind" : "Type Method",
    "modules" : [
      "Objective-C Runtime"
    ],
    "preciseIdentifier" : "c:objc(cs)NSObject(cm)isSubclassOfClass:"
  },
  "title" : "isSubclass(of:)"
}
-->

# isSubclass(of:)

Returns a Boolean value that indicates whether the receiving class is a subclass of, or identical to, a given class.

```
class func isSubclass(of aClass: AnyClass) -> Bool
```

## Parameters

`aClass`

A class object.

## Return Value

[`YES`](/documentation/ObjectiveC/YES) if the receiving class is a subclass of—or identical to—`aClass`, otherwise [`NO`](/documentation/ObjectiveC/NO).

## Discussion

---

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)