One Logo Pool Ball
SwiftUICore · IOS API REFERENCE

ShaderFunction

struct · iOS 17.0+ · SDK 27.1

@dynamicCallable struct ShaderFunction

A reference to a function in a Metal shader library.

Members (6)

method · iOS 17.0+

dynamicallyCall

TypeScript
dynamicallyCall(args: Array<Shader_Argument>): Shader
Swift declaration
func dynamicallyCall(withArguments args: [Shader.Argument]) -> Shader

Returns a new shader by applying the provided argument values to the referenced function. Typically this subscript is used implicitly via function-call syntax, for example: let shader = ShaderLibrary.default.myFunction(.float(42)) which creates a shader passing the value `42` to the first unbound parameter of `myFunction()`.

get · iOS 17.0+

name

TypeScript
get name(): string
Swift declaration
var name: String

The name of the shader function in the library.

set · iOS 17.0+

name

TypeScript
set name(value: string)
Swift declaration
var name: String

The name of the shader function in the library.

init · iOS 17.0+

init

TypeScript
static init(library: ShaderLibrary, name: string): ShaderFunction
Swift declaration
init(library: ShaderLibrary, name: String)

Creates a new function reference from the provided shader library and function name string.

get · iOS 17.0+

library

TypeScript
get library(): ShaderLibrary
Swift declaration
var library: ShaderLibrary

The shader library storing the function.

set · iOS 17.0+

library

TypeScript
set library(value: ShaderLibrary)
Swift declaration
var library: ShaderLibrary

The shader library storing the function.

Skipped declarations

No declarations were skipped in this snapshot.

All SwiftUICore types →