<!--
{
  "availability" : [
    "iOS: 8.0.0 - 26.0.0",
    "iPadOS: 8.0.0 - 26.0.0",
    "macCatalyst: 13.1.0 - 26.0.0",
    "macOS: 10.8.0 - 26.0.0",
    "tvOS: 9.0.0 - 26.0.0",
    "visionOS: 1.0.0 - 26.0.0",
    "watchOS: 3.0.0 - 26.0.0"
  ],
  "documentType" : "symbol",
  "framework" : "SceneKit",
  "identifier" : "/documentation/SceneKit/SCNSceneSource/init(data:options:)",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "SceneKit"
    ],
    "preciseIdentifier" : "c:objc(cs)SCNSceneSource(im)initWithData:options:"
  },
  "title" : "init(data:options:)"
}
-->

# init(data:options:)

Initializes a scene source for reading the scene graph contained in an `NSData` object.

```
init?(data: Data, options: [SCNSceneSource.LoadingOption : Any]? = nil)
```

## Parameters

`data`

A data object containing a scene file in a format recognized by SceneKit.

`options`

A dictionary containing options that affect scene loading. See `Scene Loading Options` for available keys and values. Pass `nil` to use default options.

## Return Value

An initialized scene source object, or `nil` if initialization was not successful.

## Discussion

The `data` parameter of this method (an <doc://com.apple.documentation/documentation/Foundation/NSData>) should contain the same data as directly read from a scene file (such as by using the <doc://com.apple.documentation/documentation/Foundation/NSData> method <doc://com.apple.documentation/documentation/Foundation/NSData/init(contentsOfURL:)-5gfaw>). Use this method when you have the contents of a scene file but not the file itself—for example, if your app downloads scene files from the network.

## See Also

[`sceneSourceWithURL:options:`](/documentation/SceneKit/SCNSceneSource/sceneSourceWithURL:options:)

Creates a scene source that reads the scene graph from a specified file.

[`sceneSourceWithData:options:`](/documentation/SceneKit/SCNSceneSource/sceneSourceWithData:options:)

Creates a scene source that reads the scene graph contained in an `NSData` object.



---

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)