---
title: layerCount
framework: metal
role: symbol
role_heading: Instance Property
path: metal/mtlrasterizationratemapdescriptor/layercount
---

# layerCount

The number of layers in the rate map.

## Declaration

```swift
var layerCount: Int { get }
```

## Discussion

Discussion The value of this property is dynamically determined based on how many layers you’ve added to the descriptor. To add a new layer, call setLayer(_:at:) or use the subscripting operator to assign a layer.

## See Also

### Configuring the rate map layers

- [layer(at:)](metal/mtlrasterizationratemapdescriptor/layer(at:).md)
- [setLayer(_:at:)](metal/mtlrasterizationratemapdescriptor/setlayer(_:at:).md)
- [layers](metal/mtlrasterizationratemapdescriptor/layers.md)
- [MTLRasterizationRateLayerArray](metal/mtlrasterizationratelayerarray.md)
