---
title: "allowedClasses(forRestorableStateKeyPath:)"
framework: appkit
role: symbol
role_heading: Type Method
path: "appkit/nsdocument/allowedclasses(forrestorablestatekeypath:)"
---

# allowedClasses(forRestorableStateKeyPath:)

Returns the classes that support secure coding.

## Declaration

```swift
class func allowedClasses(forRestorableStateKeyPath keyPath: String) -> [AnyClass]
```

## Parameters

- `keyPath`: The key path of the restorable object.

## Return Value

Return Value An array of classes that support secure coding.

## Discussion

Discussion The system calls the function during a secure state restoration and restores values only for the allowed classes your app returns in the array.

## See Also

### Handling Window Restoration

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