<!--
{
  "availability" : [
    "macOS: 10.7.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "AppKit",
  "identifier" : "/documentation/AppKit/NSWindow/restorationClass",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Property",
  "symbol" : {
    "kind" : "Instance Property",
    "modules" : [
      "AppKit"
    ],
    "preciseIdentifier" : "c:objc(cs)NSWindow(py)restorationClass"
  },
  "title" : "restorationClass"
}
-->

# restorationClass

The restoration class associated with the window.

```
var restorationClass: (any NSWindowRestoration.Type)? { get set }
```

## Discussion

The value of this property is a class object that conforms to the [`NSWindowRestoration`](/documentation/AppKit/NSWindowRestoration) protocol corresponding to the class to use to restore the window or `nil` if none is set.

The restoration class of a window is responsible for recreating not just the window but any other objects needed to manage the window. This almost always involves creating a window controller and for multi-window document applications also involves creating a document object. Therefore, the restoration class must be able to create (or find existing instances of) all of these objects at launch time in your application. When prompted by AppKit, the restoration class creates or acquires a window that matches the same type that was preserved. It then passes that window back to AppKit, which proceeds to reconfigure the window with the preserved state information.

If you mark your windows as restorable, you must associate a restoration class with them. For multi-window document applications, AppKit associates the [`NSDocumentController`](/documentation/AppKit/NSDocumentController) class with any document windows by default. That class recreates the preserved document objects, which in turn recreate the corresponding window controller and window objects. For other types of windows, you must set the restoration class explicitly.

---

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)