---
title: "functionHandle(function:)"
framework: metal
role: symbol
role_heading: Instance Method
path: "metal/mtlcomputepipelinestate/functionhandle(function:)-7d523"
---

# functionHandle(function:)

Creates a function handle for a visible function.

## Declaration

```swift
func functionHandle(function: any MTLFunction) -> (any MTLFunctionHandle)?
```

## Parameters

- `function`: An doc://com.apple.metal/documentation/Metal/MTLFunction instance that represents the visible function to create a handle for.

## Return Value

Return Value A handle to the visible function. When this value is nil, an error occurred during handle creation.
