---
title: "setTileSamplerStates(_:range:)"
framework: metal
role: symbol
role_heading: Instance Method
path: "metal/mtlrendercommandencoder/settilesamplerstates(_:range:)"
---

# setTileSamplerStates(_:range:)

Assigns multiple sampler states to a range of entries in the tile shader argument table.

## Declaration

```swift
func setTileSamplerStates(_ samplers: [(any MTLSamplerState)?], range: Range<Int>)
```

## Parameters

- `samplers`: An array of doc://com.apple.metal/documentation/Metal/MTLSamplerState instances the command assigns to entries in the tile shader argument table for sampler states.
- `range`: A span of integers that represent the entries in the tile shader argument table for sampler states. Each entry stores a record of the corresponding element in samplers.

## Discussion

Discussion By default, the sampler state at each index is nil. note: The Objective-C version of this method is setTileSamplerStates:withRange:.

## See Also

### Assigning sampler states

- [setTileSamplerState(_:index:)](metal/mtlrendercommandencoder/settilesamplerstate(_:index:).md)
- [setTileSamplerState(_:lodMinClamp:lodMaxClamp:index:)](metal/mtlrendercommandencoder/settilesamplerstate(_:lodminclamp:lodmaxclamp:index:).md)
- [setTileSamplerStates(_:lodMinClamps:lodMaxClamps:range:)](metal/mtlrendercommandencoder/settilesamplerstates(_:lodminclamps:lodmaxclamps:range:).md)
