<!--
{
  "availability" : [
    "iOS: 9.0.0 -",
    "iPadOS: 9.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.11.0 -",
    "tvOS: 9.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "ModelIO",
  "identifier" : "/documentation/ModelIO/MDLAsset/childObjects(of:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Model I/O"
    ],
    "preciseIdentifier" : "c:objc(cs)MDLAsset(im)childObjectsOfClass:"
  },
  "title" : "childObjects(of:)"
}
-->

# childObjects(of:)

Returns all objects contained in the asset of the specified class.

```
func childObjects(of objectClass: AnyClass) -> [MDLObject]
```

## Parameters

`objectClass`

A Model I/O class (that is, a subclass of [`MDLObject`](/documentation/ModelIO/MDLObject)) representing a type of object stored in the asset. For example, pass the [`MDLMesh`](/documentation/ModelIO/MDLMesh) class to find all 3D objects stored in the asset, or the [`MDLLight`](/documentation/ModelIO/MDLLight) class to find all light sources.

## Return Value

An array of objects of the specified type, or an empty array if no such objects exist.

## Discussion

This method searches the asset’s entire child object hierarchy to find all objects of the specified type contained in the asset.

---

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)