Instance Method


Adds a child object to this object, creating a container for the object’s children if necessary.


func addChild(_ child: MDLObject)



The child object to add.


Many asset formats describe a hierarchy of transforms that model the spatial relationships between meshes, lights, and cameras in the asset. In such formats, hierarchic transforms are MDLObject instances whose children property references the objects affected by the transform—and those objects can be other MDLObject instances with children of their own.

If the object’s children property is nil, this method sets that property to a new MDLObjectContainer instance before adding the child object.

See Also

Working with Object Hierarchies

var parent: MDLObject?

The parent object that contains this object.

var children: MDLObjectContainerComponent

A component that manages this object’s collection of children.

var path: String

A path that identifies the object in an asset's object hierarchy using object names.

func atPath(String) -> MDLObject

Returns the child object at the specified path.

Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software