<!--
{
  "availability" : [
    "iOS: 9.0.0 -",
    "iPadOS: 9.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.11.0 -",
    "tvOS: 9.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 2.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "SpriteKit",
  "identifier" : "/documentation/SpriteKit/SKReferenceNode",
  "metadataVersion" : "0.1.0",
  "role" : "Class",
  "symbol" : {
    "kind" : "Class",
    "modules" : [
      "SpriteKit"
    ],
    "preciseIdentifier" : "c:objc(cs)SKReferenceNode"
  },
  "title" : "SKReferenceNode"
}
-->

# SKReferenceNode

A node that’s defined in an archived `.sks` file.

```
class SKReferenceNode
```

## Overview

`SKReferenceNode` is used within an archived `.sks` file to refer to node defined in another `.sks` file without duplicating its definition. This way, a change to the referenced node propagates to all the references in other files.

> Note:
> `SKReferenceNode` is mostly used in conjunction with Xcode’s SpriteKit Scene editor, but it’s possible to instantiate it yourself and use the ``doc://com.apple.spritekit/documentation/SpriteKit/SKReferenceNode/resolve()`` function as a handy way to restore a node’s appearance.

As an example, you might want to share an enemy ship across two different levels, Scene1.sks and Scene2.sks, in a level-based game. Reference nodes allow you to do that without creating copies of the shared node and its properties.

To use a reference node:

- Create the shared content in a separate archive
- Add references to the shared archive within your scene archives

When each scene is loaded, the reference nodes are resolved dynamically, and therefore you only need to configure a shared object in one place.

## Topics

### Initializers

[`+  referenceNodeWithURL:`](/documentation/SpriteKit/SKReferenceNode/init(url:)-3jryz)

Creates a reference node from a URL.

[`-  initWithURL:`](/documentation/SpriteKit/SKReferenceNode/init(url:)-429mo)

Initializes a reference node from a URL.

[`+  referenceNodeWithFileNamed:`](/documentation/SpriteKit/SKReferenceNode/init(fileNamed:)-77gs0)

Creates a reference node from a file in the app’s main bundle.

[`-  initWithFileNamed:`](/documentation/SpriteKit/SKReferenceNode/init(fileNamed:)-2yeh2)

Initializes a reference node from a file in the app’s main bundle.

[`-  initWithCoder:`](/documentation/SpriteKit/SKReferenceNode/init(coder:))

A method that initializes a reference node from an archive.

### Regenerating

Load a reference nodes contents freshly from the archive again.

[`-  resolveReferenceNode`](/documentation/SpriteKit/SKReferenceNode/resolve())

Loads the reference node’s content and adds it as a new child node.

### Loading Callback

[`-  didLoadReferenceNode:`](/documentation/SpriteKit/SKReferenceNode/didLoad(_:))

A method called by SpriteKit after the reference node’s contents are loaded.

## Relationships

### Conforms To

[`UIFocusEnvironment`](/documentation/UIKit/UIFocusEnvironment)

[`NSUserActivityRestoring`](/documentation/AppKit/NSUserActivityRestoring)

[`NSSecureCoding`](/documentation/Foundation/NSSecureCoding)

[`UIUserActivityRestoring`](/documentation/UIKit/UIUserActivityRestoring)

[`CustomStringConvertible`](/documentation/Swift/CustomStringConvertible)

[`UIFocusItemContainer`](/documentation/UIKit/UIFocusItemContainer)

[`Sendable`](/documentation/Swift/Sendable)

[`UIResponderStandardEditActions`](/documentation/UIKit/UIResponderStandardEditActions)

[`CVarArg`](/documentation/Swift/CVarArg)

[`NSStandardKeyBindingResponding`](/documentation/AppKit/NSStandardKeyBindingResponding)

[`NSTouchBarProvider`](/documentation/AppKit/NSTouchBarProvider)

[`UIActivityItemsConfigurationProviding`](/documentation/UIKit/UIActivityItemsConfigurationProviding)

[`UIFocusItem`](/documentation/UIKit/UIFocusItem)

[`UICoordinateSpace`](/documentation/UIKit/UICoordinateSpace)

[`Equatable`](/documentation/Swift/Equatable)

[`UIPasteConfigurationSupporting`](/documentation/UIKit/UIPasteConfigurationSupporting)

[`NSObjectProtocol`](/documentation/ObjectiveC/NSObjectProtocol)

[`CustomDebugStringConvertible`](/documentation/Swift/CustomDebugStringConvertible)

[`NSCopying`](/documentation/Foundation/NSCopying)

[`NSCoding`](/documentation/Foundation/NSCoding)

[`SendableMetatype`](/documentation/Swift/SendableMetatype)

[`Hashable`](/documentation/Swift/Hashable)

### Inherits From

[`SKNode`](/documentation/SpriteKit/SKNode)

---

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)