<!--
{
  "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/SCNParticleSystem/init(named:inDirectory:)",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "SceneKit"
    ],
    "preciseIdentifier" : "c:objc(cs)SCNParticleSystem(cm)particleSystemNamed:inDirectory:"
  },
  "title" : "init(named:inDirectory:)"
}
-->

# init(named:inDirectory:)

Loads a particle system from a file in the app’s bundle resources.

```
convenience init?(named name: String, inDirectory directory: String?)
```

## Parameters

`name`

The name of a particle system file in the app’s bundle resources directory, with or without the `.scnp` extension.

`directory`

The subdirectory path in the app’s bundle resources directory.

## Return Value

A new particle system instantiated from the contents of the file.

## Discussion

A SceneKit particle file created by Xcode contains an archived [`SCNParticleSystem`](/documentation/SceneKit/SCNParticleSystem) instance, so you can also use the <doc://com.apple.documentation/documentation/Foundation/NSKeyedArchiver> and <doc://com.apple.documentation/documentation/Foundation/NSKeyedUnarchiver> classes to write and read particle files.

---

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)