<!--
{
  "availability" : [
    "iOS: 8.0.0 -",
    "iPadOS: 8.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.11.0 -",
    "tvOS: -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Metal",
  "identifier" : "/documentation/Metal/MTLTextureDescriptor/arrayLength",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Property",
  "symbol" : {
    "kind" : "Instance Property",
    "modules" : [
      "Metal"
    ],
    "preciseIdentifier" : "c:objc(cs)MTLTextureDescriptor(py)arrayLength"
  },
  "title" : "arrayLength"
}
-->

# arrayLength

The number of array elements for this texture.

```
var arrayLength: Int { get set }
```

## Discussion

The value of this property needs to be between `1` and `2048`, inclusive. The default value is `1`.

This value is `1` if the texture type is not an array.

This value can be between `1` and `2048` if the texture type is one of the following array types:

- [`MTLTextureType.type1DArray`](/documentation/Metal/MTLTextureType/type1DArray)
- [`MTLTextureType.type2DArray`](/documentation/Metal/MTLTextureType/type2DArray)
- [`MTLTextureType.type2DMultisampleArray`](/documentation/Metal/MTLTextureType/type2DMultisampleArray)
- [`MTLTextureType.typeCubeArray`](/documentation/Metal/MTLTextureType/typeCubeArray)

---

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)