Instance Method


Returns the vertex data for the specified attribute.


func vertexAttributeData(forAttributeNamed name: String) -> MDLVertexAttributeData?



The attribute name for which to retrieve data. See Vertex Attributes for standard attribute names.

Return Value

The vertex data for the specified attribute, or nil if the mesh does not contain vertex data for the specified attribute.


Calling this data is equivalent to using the mesh’s vertexDescriptor object to find the index of the MDLMeshBuffer object corresponding to the specified vertex attribute in the mesh’s vertexBuffers array, then using the vertex buffer’s map() method to gain read-only access to the vertex buffer’s data.

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