Instance Method


Adds the specified vertex attribute to the vertex descriptor, replacing any existing attribute with the same name.


func addOrReplaceAttribute(_ attribute: MDLVertexAttribute)



The vertex attribute to add to the vertex descriptor.


If the vertex descriptor contains an attribute whose name property is the same as that of the attribute parameter, the new attribute replaces the existing attribute in the attributes array. Otherwise, this method adds the new attribute to the end of the attributes array.

See Also

Working with Vertex Attributes

var attributes: NSMutableArray

The list of vertex attributes described by the vertex descriptor.

func attributeNamed(String) -> MDLVertexAttribute?

Returns the vertex attribute with the specified name in the vertex descriptor.

func setPackedOffsets()

Sets the offset for each vertex attribute to the minimum value to pack vertex data together in a single buffer.

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