<!--
{
  "availability" : [
    "iOS: -",
    "iPadOS: -",
    "macCatalyst: -",
    "visionOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "UIKit",
  "identifier" : "/documentation/UIKit/UIDocument/SaveOperation",
  "metadataVersion" : "0.1.0",
  "role" : "Enumeration",
  "symbol" : {
    "kind" : "Enumeration",
    "modules" : [
      "UIKit"
    ],
    "preciseIdentifier" : "c:@E@UIDocumentSaveOperation"
  },
  "title" : "UIDocument.SaveOperation"
}
-->

# UIDocument.SaveOperation

Constants that specify the type of save operation.

```
enum SaveOperation
```

## Overview

You specify one of these constants as a parameter in the following methods: [`save(to:for:completionHandler:)`](/documentation/UIKit/UIDocument/save(to:for:completionHandler:)), [`writeContents(_:andAttributes:safelyTo:for:)`](/documentation/UIKit/UIDocument/writeContents(_:andAttributes:safelyTo:for:)), [`writeContents(_:to:for:originalContentsURL:)`](/documentation/UIKit/UIDocument/writeContents(_:to:for:originalContentsURL:)), [`fileAttributesToWrite(to:for:)`](/documentation/UIKit/UIDocument/fileAttributesToWrite(to:for:)), [`fileNameExtension(forType:saveOperation:)`](/documentation/UIKit/UIDocument/fileNameExtension(forType:saveOperation:)), [`changeCountToken(for:)`](/documentation/UIKit/UIDocument/changeCountToken(for:)), and [`updateChangeCount(withToken:for:)`](/documentation/UIKit/UIDocument/updateChangeCount(withToken:for:)).

## Topics

### Constants

[`UIDocumentSaveForCreating`](/documentation/UIKit/UIDocument/SaveOperation/forCreating)

The document is being saved for the first time.

[`UIDocumentSaveForOverwriting`](/documentation/UIKit/UIDocument/SaveOperation/forOverwriting)

The document is being saved by overwriting the current version.

## Relationships

### Conforms To

[`Sendable`](/documentation/Swift/Sendable)

[`BitwiseCopyable`](/documentation/Swift/BitwiseCopyable)

[`Hashable`](/documentation/Swift/Hashable)

[`SendableMetatype`](/documentation/Swift/SendableMetatype)

[`Equatable`](/documentation/Swift/Equatable)

[`RawRepresentable`](/documentation/Swift/RawRepresentable)

---

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)