---
title: "childObjects(of:)"
framework: modelio
role: symbol
role_heading: Instance Method
path: "modelio/mdlasset/childobjects(of:)"
---

# childObjects(of:)

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

## Declaration

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

## Parameters

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

## Return Value

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

## Discussion

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

## See Also

### Working with Asset Content

- [object(at:)](modelio/mdlasset/object(at:).md)
- [subscript(_:)](modelio/mdlasset/subscript(_:).md)
- [count](modelio/mdlasset/count.md)
- [add(_:)](modelio/mdlasset/add(_:).md)
- [remove(_:)](modelio/mdlasset/remove(_:).md)
- [boundingBox](modelio/mdlasset/boundingbox.md)
- [boundingBox(atTime:)](modelio/mdlasset/boundingbox(attime:).md)
- [url](modelio/mdlasset/url.md)
- [bufferAllocator](modelio/mdlasset/bufferallocator.md)
- [vertexDescriptor](modelio/mdlasset/vertexdescriptor.md)
- [masters](modelio/mdlasset/masters.md)
