---
title: "init(source:uniforms:)"
framework: spritekit
role: symbol
role_heading: Initializer
path: "spritekit/skshader/init(source:uniforms:)"
---

# init(source:uniforms:)

Initializes a new shader object using the specified source and uniform data.

## Declaration

```swift
init(source: String, uniforms: [SKUniform])
```

## Parameters

- `source`: A string that holds the initial source for the shader.
- `uniforms`: A list of uniforms to add to the shader object.

## Return Value

Return Value An initialized shader object.

## See Also

### Creating a Shader

- [Creating a Custom Fragment Shader](spritekit/creating-a-custom-fragment-shader.md)
- [init(fileNamed:)](spritekit/skshader/init(filenamed:).md)
- [init(source:)](spritekit/skshader/init(source:).md)
