---
title: "setFunction(_:index:)"
framework: metal
role: symbol
role_heading: Instance Method
path: "metal/mtlintersectionfunctiontable/setfunction(_:index:)"
---

# setFunction(_:index:)

Sets an entry in the table.

## Declaration

```swift
func setFunction(_ function: (any MTLFunctionHandle)?, index: Int)
```

## Parameters

- `function`: A function handle for the intersection function.
- `index`: The index of the table entry to change.

## See Also

### Setting a table entry

- [setFunctions(_:range:)](metal/mtlintersectionfunctiontable/setfunctions(_:range:).md)
