<!--
{
  "availability" : [
    "iOS: 17.0.0 -",
    "iPadOS: 17.0.0 -",
    "macCatalyst: 17.0.0 -",
    "macOS: 14.0.0 -",
    "tvOS: 17.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "SwiftUI",
  "identifier" : "/documentation/SwiftUI/ShaderLibrary/subscript(dynamicMember:)-swift.subscript",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Subscript",
  "symbol" : {
    "kind" : "Instance Subscript",
    "modules" : [
      "SwiftUI"
    ],
    "preciseIdentifier" : "s:7SwiftUI13ShaderLibraryV13dynamicMemberAA0C8FunctionVSS_tcip"
  },
  "title" : "subscript(dynamicMember:)"
}
-->

# subscript(dynamicMember:)

Returns a new shader function representing the stitchable MSL
function in the library called `name`.

```
subscript(dynamicMember name: String) -> ShaderFunction { get }
```

## Overview

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()`.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)