The base protocol for extensible file format support in Model I/O.
- iOS 9.0+
- macOS 10.11+
- Mac Catalyst 13.0+
- tvOS 9.0+
- Model I/O
Model I/O adopts this pattern to support container objects (with the
MDLObject protocol) and objects with associated transformations (with the
MDLTransform protocol). To work with these aspects of a Model I/O object, call the object’s
component method with the appropriate protocol. (The
MDLObject class also provides convenience methods and properties for accessing features of these components without directly accessing the component instances.)
To add your own object features, first define a protocol that extends the
MDLComponent protocol, implement a class that adopts that protocol, and then use the
set method to add your component to each object that needs it. The example below shows how you might implement a file format that associates scripting event triggers with parts of a game scene.