<!--
{
  "availability" : [
    "iOS: 9.0.0 -",
    "iPadOS: 9.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.11.0 -",
    "tvOS: 9.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "ModelIO",
  "identifier" : "/documentation/ModelIO/MDLMeshBufferData/init(type:data:)",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "Model I/O"
    ],
    "preciseIdentifier" : "c:objc(cs)MDLMeshBufferData(im)initWithType:data:"
  },
  "title" : "init(type:data:)"
}
-->

# init(type:data:)

Initializes a buffer containing the specified data.

```
init(type: MDLMeshBufferType, data: Data?)
```

## Parameters

`type`

[`MDLMeshBufferType.vertex`](/documentation/ModelIO/MDLMeshBufferType/vertex) to create a buffer for a mesh’s vertex attribute data, or [`MDLMeshBufferType.index`](/documentation/ModelIO/MDLMeshBufferType/index) to create a buffer for a submesh’s index data.

`data`

The initial data to copy into the buffer.

## Return Value

A new memory buffer for mesh data.

---

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)