One Logo Pool Ball
SwiftUICore · IOS API REFERENCE

ShaderLibrary

struct · iOS 17.0+ · SDK 27.1

@dynamicMemberLookup struct ShaderLibrary

A Metal shader library.

Members (5)

subscript · iOS 17.0+

subscript

TypeScript
subscript(name: string): ShaderFunction
Swift declaration
subscript(dynamicMember name: String) -> ShaderFunction { get }

Returns a new shader function representing the stitchable MSL function in the library called `name`. Typically this subscript is used implicitly via the dynamic member syntax, for example: let fn = ShaderLibrary.default.myFunction which creates a reference to the MSL function called `myFunction()`.

init · iOS 17.0+

init

TypeScript
static initUrl(url: string): ShaderLibrary
Swift declaration
init(url: URL)

Creates a new Metal shader library from the contents of `url`, which must be the location of precompiled Metal library. Functions compiled from the returned library will only be cached as long as the returned library exists.

init · iOS 17.0+

init

TypeScript
static initData(data: ArrayBuffer): ShaderLibrary
Swift declaration
init(data: Data)

Creates a new Metal shader library from `data`, which must be the contents of precompiled Metal library. Functions compiled from the returned library will only be cached as long as the returned library exists.

static · iOS 17.0+

bundle

TypeScript
static bundle(bundle: _Foundation_Bundle): ShaderLibrary
Swift declaration
static func bundle(_ bundle: Bundle) -> ShaderLibrary

Returns the default shader library of the specified bundle.

get · iOS 17.0+

default

TypeScript
static get default(): ShaderLibrary
Swift declaration
static let `default`: ShaderLibrary

The default shader library of the main (i.e. app) bundle.

Skipped declarations

No declarations were skipped in this snapshot.

All SwiftUICore types →