<!--
{
  "availability" : [
    "iOS: 11.0.0 -",
    "iPadOS: 11.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.13.0 -",
    "tvOS: 11.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "ModelIO",
  "identifier" : "/documentation/ModelIO/MDLObject/enumerateChildObjects(of:root:using:stopPointer:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Model I/O"
    ],
    "preciseIdentifier" : "c:objc(cs)MDLObject(im)enumerateChildObjectsOfClass:root:usingBlock:stopPointer:"
  },
  "title" : "enumerateChildObjects(of:root:using:stopPointer:)"
}
-->

# enumerateChildObjects(of:root:using:stopPointer:)

Executes the specified block using each object in this object’s child hierarchy.

```
func enumerateChildObjects(of objectClass: AnyClass, root: MDLObject, using block: @escaping (MDLObject, UnsafeMutablePointer<ObjCBool>) -> Void, stopPointer: UnsafeMutablePointer<ObjCBool>)
```

## Parameters

`objectClass`

A Model I/O class representing a type of child objects to evaluate. For example, pass the [`MDLMesh`](/documentation/ModelIO/MDLMesh) class to evaluate all 3D objects stored in the asset. Pass the [`MDLObject`](/documentation/ModelIO/MDLObject) class to evaluate all child objects regardless of type.

`root`

The root object at which to begin traversing the child object hierarchy.

`block`

The block to apply to child objects. This block takes two parameters: the `object` to be evaluated by the block, and a `stop` pointer that you can set to <doc://com.apple.documentation/documentation/Swift/true> to stop further evaluation of the object hierarchy.

`stopPointer`

Set this pointer’s value to <doc://com.apple.documentation/documentation/Swift/true> during enumeration to stop further enumeration of the object hierarchy.

---

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)