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

# preservesVersions

A Boolean value that indicates whether the document subclass supports version management.

```
class var preservesVersions: Bool { get }
```

## Return Value

<doc://com.apple.documentation/documentation/Swift/true> if the receiving subclass of [`NSDocument`](/documentation/AppKit/NSDocument) supports Versions; otherwise <doc://com.apple.documentation/documentation/Swift/false>.

## Discussion

The default implementation of this method returns `[self autosavesInPlace]`. You can override it and return <doc://com.apple.documentation/documentation/Swift/false> to declare that `NSDocument` should not preserve old document versions.

Returning <doc://com.apple.documentation/documentation/Swift/false> from this method disables version browsing and [`revertToSaved(_:)`](/documentation/AppKit/NSDocument/revertToSaved(_:)), which rely on version preservation when autosaving in place. Returning <doc://com.apple.documentation/documentation/Swift/true> from this method when [`autosavesInPlace`](/documentation/AppKit/NSDocument/autosavesInPlace) returns <doc://com.apple.documentation/documentation/Swift/false> will result in undefined behavior.

---

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)