<!--
{
  "availability" : [
    "iOS: 13.0.0 -",
    "iPadOS: 13.0.0 -",
    "macCatalyst: 13.1.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "QuickLook",
  "identifier" : "/documentation/QuickLook/QLPreviewControllerDelegate/previewController(_:didSaveEditedCopyOf:at:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Quick Look"
    ],
    "preciseIdentifier" : "c:objc(pl)QLPreviewControllerDelegate(im)previewController:didSaveEditedCopyOfPreviewItem:atURL:"
  },
  "title" : "previewController(_:didSaveEditedCopyOf:at:)"
}
-->

# previewController(_:didSaveEditedCopyOf:at:)

Tells the delegate that the preview item’s edited content was successfully saved to a copy at the given URL.

```
optional func previewController(_ controller: QLPreviewController, didSaveEditedCopyOf previewItem: any QLPreviewItem, at modifiedContentsURL: URL)
```

## Parameters

`controller`

The controller that displays the preview.

`previewItem`

The preview item for a file.

`modifiedContentsURL`

A URL pointing to a temporary file that contains the edited version of the previewed file.

## Discussion

The platform invokes this callback with an edited copy of the preview item at `modifiedContentsURL`. It invokes the callback in the following scenarios:

- The editing mode of the `previewItem` is [`QLPreviewItemEditingMode.createCopy`](/documentation/QuickLook/QLPreviewItemEditingMode/createCopy).
- The editing mode of the `previewItem` is [`QLPreviewItemEditingMode.updateContents`](/documentation/QuickLook/QLPreviewItemEditingMode/updateContents) and the system can’t overwrite its [`previewItemURL`](/documentation/QuickLook/QLPreviewItem/previewItemURL). In this case, `modifiedContentsURL` points to a temporary file on disk containing the edited copy.
- The editing mode of the preview item is [`QLPreviewItemEditingMode.updateContents`](/documentation/QuickLook/QLPreviewItemEditingMode/updateContents) and its content type doesn’t match the content type of the edited version. This mismatch means that the file type of the file at `modifiedContentsURL` may be different from the file type of the preview item.

The platform may invoke the callback multiple times consecutively with the successive edited versions of the preview item. It typically invokes the callback once for each time the user saves their edits.

---

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)