---
title: "openDirectory(containerIdentifier:)"
framework: gamesave
role: symbol
role_heading: Type Method
path: "gamesave/gamesavesynceddirectory/opendirectory(containeridentifier:)"
---

# openDirectory(containerIdentifier:)

Requests an instance of the game-save directory.

## Declaration

```swift
class func openDirectory(containerIdentifier: String? = nil) -> GameSaveSyncedDirectory
```

## Parameters

- `containerIdentifier`: The identifier of the directory to request. If you pass nil, this method uses the first container identifier listed in the com.apple.developer.icloud-container-identifiers entitlements array.

## Discussion

Discussion This method returns immediately, and starts syncing the directory in the background. To wait for syncing to complete, call the finishSyncing() method.

## See Also

### Accessing a directory

- [GameSaveSyncedDirectory.State](gamesave/gamesavesynceddirectory/state-swift.enum.md)
- [state](gamesave/gamesavesynceddirectory/state-swift.property.md)
