---
title: "init(data:)"
framework: swiftui
role: symbol
role_heading: Initializer
path: "swiftui/shaderlibrary/init(data:)"
---

# init(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.

## Declaration

```swift
init(data: Data)
```

## See Also

### Creating a shader library

- [init(url:)](swiftui/shaderlibrary/init(url:).md)
