---
title: arrayLength
framework: metal
role: symbol
role_heading: Instance Property
path: metal/mtltexturedescriptor/arraylength
---

# arrayLength

The number of array elements for this texture.

## Declaration

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

## Discussion

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 MTLTextureType.type2DArray MTLTextureType.type2DMultisampleArray MTLTextureType.typeCubeArray

## See Also

### Specifying texture attributes

- [textureType](metal/mtltexturedescriptor/texturetype.md)
- [pixelFormat](metal/mtltexturedescriptor/pixelformat.md)
- [width](metal/mtltexturedescriptor/width.md)
- [height](metal/mtltexturedescriptor/height.md)
- [depth](metal/mtltexturedescriptor/depth.md)
- [mipmapLevelCount](metal/mtltexturedescriptor/mipmaplevelcount.md)
- [sampleCount](metal/mtltexturedescriptor/samplecount.md)
- [resourceOptions](metal/mtltexturedescriptor/resourceoptions.md)
- [cpuCacheMode](metal/mtltexturedescriptor/cpucachemode.md)
- [storageMode](metal/mtltexturedescriptor/storagemode.md)
- [hazardTrackingMode](metal/mtltexturedescriptor/hazardtrackingmode.md)
- [allowGPUOptimizedContents](metal/mtltexturedescriptor/allowgpuoptimizedcontents.md)
- [usage](metal/mtltexturedescriptor/usage.md)
- [swizzle](metal/mtltexturedescriptor/swizzle.md)
- [MTLTextureSwizzleChannels](metal/mtltextureswizzlechannels.md)
