---
title: "init(named:inDirectory:)"
framework: scenekit
role: symbol
role_heading: Initializer
path: "scenekit/scnparticlesystem/init(named:indirectory:)"
---

# init(named:inDirectory:)

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

## Declaration

```swift
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

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

## Discussion

Discussion A SceneKit particle file created by Xcode contains an archived SCNParticleSystem instance, so you can also use the NSKeyedArchiver and NSKeyedUnarchiver classes to write and read particle files.
