---
title: "setLayer(_:at:)"
framework: metal
role: symbol
role_heading: Instance Method
path: "metal/mtlrasterizationratemapdescriptor/setlayer(_:at:)"
---

# setLayer(_:at:)

Sets a configuration for a layer rate map.

## Declaration

```swift
func setLayer(_ layer: MTLRasterizationRateLayerDescriptor?, at layerIndex: Int)
```

## Parameters

- `layer`: A description of a layer to add to the rate map descriptor. Use nil to remove the layer at that index.
- `layerIndex`: The index to put the new layer description in.

## Discussion

Discussion Calling this method is equivalent to using array subscript syntax.

## See Also

### Configuring the rate map layers

- [layerCount](metal/mtlrasterizationratemapdescriptor/layercount.md)
- [layer(at:)](metal/mtlrasterizationratemapdescriptor/layer(at:).md)
- [layers](metal/mtlrasterizationratemapdescriptor/layers.md)
- [MTLRasterizationRateLayerArray](metal/mtlrasterizationratelayerarray.md)
