---
title: restorableStateKeyPaths
framework: appkit
role: symbol
role_heading: Type Property
path: appkit/nsdocument/restorablestatekeypaths
---

# restorableStateKeyPaths

Returns an array of key paths that represent the restorable attributes of the document.

## Declaration

```swift
class var restorableStateKeyPaths: [String] { get }
```

## Return Value

Return Value An array of NSString objects, each of which contains a key path to one of the document’s attributes.

## Discussion

Discussion You can use this method instead of, or in addition to, the encodeRestorableState(with:) and restoreState(with:) methods to save and restore the state of your document. The key paths must refer to attributes that are Key-value coding and Key-value observing compliant. When changes are detected, the specified attributes are automatically written to disk with the rest of the app’s interface-related state. At launch time, the attributes are automatically restored to their previous values.

## See Also

### Handling Window Restoration

- [allowedClasses(forRestorableStateKeyPath:)](appkit/nsdocument/allowedclasses(forrestorablestatekeypath:).md)
- [encodeRestorableState(with:)](appkit/nsdocument/encoderestorablestate(with:).md)
- [restoreState(with:)](appkit/nsdocument/restorestate(with:).md)
- [invalidateRestorableState()](appkit/nsdocument/invalidaterestorablestate().md)
- [restoreWindow(withIdentifier:state:completionHandler:)](appkit/nsdocument/restorewindow(withidentifier:state:completionhandler:).md)
