<!--
{
  "availability" : [
    "iOS: -",
    "iPadOS: -",
    "macCatalyst: -",
    "macOS: -",
    "tvOS: -",
    "visionOS: -",
    "watchOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "SpriteKit",
  "identifier" : "/documentation/SpriteKit/SKNode/init(fileNamed:)",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "SpriteKit"
    ],
    "preciseIdentifier" : "c:objc(cs)SKNode(cm)nodeWithFileNamed:"
  },
  "title" : "init(fileNamed:)"
}
-->

# init(fileNamed:)

Creates a new node by loading an archive file from the game’s main bundle.

```
convenience init?(fileNamed filename: String)
```

## Parameters

`filename`

The name of the file, without a file extension. The file must be in the app’s main bundle and have a `.sks` filename extension.

## Return Value

The unarchived node object.

## Discussion

If you call this method on a subclass of the [`SKScene`](/documentation/SpriteKit/SKScene) class and the object in the archive is an [`SKScene`](/documentation/SpriteKit/SKScene) object, the returned object is initialized as if it is a member of the subclass. You use this behavior to create scene layouts in the Xcode Editor and provide custom behaviors in your subclass.

---

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)