---
title: "reflection(functionName:)"
framework: metal
role: symbol
role_heading: Instance Method
path: "metal/mtllibrary/reflection(functionname:)"
---

# reflection(functionName:)

Retrieves reflection information for a function in the library.

## Declaration

```swift
func reflection(functionName: String) -> MTLFunctionReflection?
```

## Parameters

- `functionName`: The name of a GPU function in the library. The name needs to match one of the elements in the string array of library’s doc://com.apple.metal/documentation/Metal/MTLLibrary/functionNames property.

## Return Value

Return Value An MTLFunctionReflection instance when the method succeeds; otherwise nil.

## Discussion

Discussion The reflection instance contains metadata information about a specific GPU function, which can include: Function parameters Return types Bindings Annotations from a developer, if available note: The Metal compiler generates the function’s reflection information when you or Xcode build the library. The method only returns reflection information if all of the following conditions apply: The library has a function with a name that matches functionName. The deployment target is macOS 13.0 or later, or iOS 16.0 or later, or visionOS 2.0 or later.
