<!--
{
  "availability" : [
    "iOS: 8.0.0 -",
    "iPadOS: 8.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.10.0 -",
    "tvOS: -",
    "visionOS: 1.0.0 -",
    "watchOS: 2.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "SpriteKit",
  "identifier" : "/documentation/SpriteKit/SKUniform/init(name:)",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "SpriteKit"
    ],
    "preciseIdentifier" : "c:objc(cs)SKUniform(im)initWithName:"
  },
  "title" : "init(name:)"
}
-->

# init(name:)

Initializes a new uniform object.

```
init(name: String)
```

## Parameters

`name`

The name used to identify the uniform variable; you use this name inside your shader to read the uniform variable’s value.

## Return Value

An initialized uniform object.

## Discussion

A uniform initialized with this method has no initial type and cannot be used in a shader until it is given an initial value. To set the initial value, use one of the properties defined in [`SKUniform`](/documentation/SpriteKit/SKUniform). After its value is set, its [`uniformType`](/documentation/SpriteKit/SKUniform/uniformType) property is set to match the uniform’s new type. Once set, the type may not be changed.

---

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)