One Logo Pool Ball
ComputeGraph · IOS API REFERENCE

ComputeNodeGraph.Library

class · iOS 27.0+ · SDK 27.1

final class Library

A class defining a library of node definitions that can be added to a ComputeNodeGraph A Library contains definitions and also stores MTLFunction implementations for built-in nodes and you can construct new libraries containing nodes you provide. These nodes are functions implemented using the Metal Shading Language and annotated with the `[[stitchable]]` attribute.

Members (11)

method · iOS 27.0+

definition

TypeScript
definitionNamedIn(name: string, bundle?: (string) | null): (ComputeNodeGraph_NodeDefinition) | null
Swift declaration
final func definition(named name: String, in bundle: String? = nil) -> ComputeNodeGraph.NodeDefinition?

Returns the first node definition with the given name, or `nil` if none is found. Pass `nil` for `bundle` to search across all bundles.

method · iOS 27.0+

definition

TypeScript
definitionStage(stage: ComputeNodeGraph_Stage): (ComputeNodeGraph_NodeDefinition) | null
Swift declaration
final func definition(stage: ComputeNodeGraph.Stage) -> ComputeNodeGraph.NodeDefinition?

Returns a definition for the given stage.

get · iOS 27.0+

definitions

TypeScript
get definitions(): Array<ComputeNodeGraph_NodeDefinition>
Swift declaration
final var definitions: [ComputeNodeGraph.NodeDefinition] { get }

The collection of all node definitions available in this library.

method · iOS 27.0+

definitionsMatching

TypeScript
definitionsMatchingInput(type: ComputeNodeGraph_ValueType): Array<ComputeNodeGraph_NodeDefinition>
Swift declaration
final func definitionsMatching(input type: ComputeNodeGraph.ValueType) -> [ComputeNodeGraph.NodeDefinition]

Returns all definitions that have at least one input matching the given value type.

method · iOS 27.0+

definitionsMatching

TypeScript
definitionsMatchingInputs(inputTypes: Array<ComputeNodeGraph_ValueType>): Array<ComputeNodeGraph_NodeDefinition>
Swift declaration
final func definitionsMatching(inputs inputTypes: [ComputeNodeGraph.ValueType]) -> [ComputeNodeGraph.NodeDefinition]

Returns all definitions whose user-editable inputs, in order, match the given value types. Non-user-editable inputs (framework-injected contexts, state bindings, etc.) are skipped when comparing the input sequence — callers pass only the user-visible types.

method · iOS 27.0+

definitionsMatching

TypeScript
definitionsMatchingOutput(type: ComputeNodeGraph_ValueType): Array<ComputeNodeGraph_NodeDefinition>
Swift declaration
final func definitionsMatching(output type: ComputeNodeGraph.ValueType) -> [ComputeNodeGraph.NodeDefinition]

Returns all definitions that have at least one output matching the given value type.

init · iOS 27.0+

init

TypeScript
static initFromBundleIdentifier(library: SDKHandle, bundleIdentifier?: (string) | null): ComputeNodeGraph_Library
Swift declaration
convenience init(from library: any MTLLibrary, bundleIdentifier: String?)

Creates a library by extracting node definitions from a Metal library.

method · iOS 27.0+

merge

TypeScript
merge(library: ComputeNodeGraph_Library): void
Swift declaration
final func merge(contentsOf library: ComputeNodeGraph.Library)

Merges nodes from specified library into this library. Use this method to merge libraries. If two nodes have the same name and bundle, the nodes in `library` will replace ones in `self`.

init · iOS 27.0+

init

TypeScript
static initBundle(bundle: _Foundation_Bundle): (ComputeNodeGraph_Library) | null
Swift declaration
convenience init?(bundle: Bundle)

Creates a library from the Metal default library in the given bundle, if available.

get · iOS 27.0+

shared

TypeScript
static get shared(): ComputeNodeGraph_Library
Swift declaration
static let shared: ComputeNodeGraph.Library
init · iOS 27.0+

init

TypeScript
static init(): ComputeNodeGraph_Library
Swift declaration
init()

Creates a new empty library.

Skipped declarations

No declarations were skipped in this snapshot.

All ComputeGraph types →