<!--
{
  "availability" : [
    "iOS: 8.0.0 -",
    "iPadOS: 8.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.15.0 -",
    "tvOS: 10.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "PhotoKit",
  "identifier" : "/documentation/Photos/PHContentEditingOutput/init(placeholderForCreatedAsset:)",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "Photos"
    ],
    "preciseIdentifier" : "c:objc(cs)PHContentEditingOutput(im)initWithPlaceholderForCreatedAsset:"
  },
  "title" : "init(placeholderForCreatedAsset:)"
}
-->

# init(placeholderForCreatedAsset:)

Creates an editing output for use in adding a new asset to the photo library.

```
init(placeholderForCreatedAsset: PHObjectPlaceholder)
```

## Parameters

`placeholderForCreatedAsset`

A placeholder object that ties the editing output to a [`PHAssetChangeRequest`](/documentation/Photos/PHAssetChangeRequest) object for creating a new asset.

## Return Value

An initialized content editing output.

## Discussion

Use this method to add a new asset to the Photos library with edited content, as opposed to editing the content of an asset after adding it to the library. For example, you might use this option if your app applies filters to photos it captures with the device camera — instead of saving only the filtered image to the Photos library, your app can save both the filtered and the original image, allowing the user to revert to the original image or apply different filters later. The code below illustrates such a workflow.

```objc
[[PHPhotoLibrary sharedPhotoLibrary] performChanges:^{
 
    // Make a change request for adding an asset.
    PHAssetChangeRequest *changeRequest =
        [PHAssetChangeRequest creationRequestForAssetFromImageAtFileURL:originalJPEGFileURL];
 
    // Make a content editing output for use with the change request.
    PHObjectPlaceholder *placeholder = changeRequest.placeholderForCreatedAsset;
    PHContentEditingOutput *contentEditingOutput =
        [[PHContentEditingOutput alloc] initWithPlaceholderForCreatedAsset:placeholder];
 
    // Apply content adjustments to the newly created asset.
    contentEditingOutput.adjustmentData = adjustmentData;
    [adjustedJPEGData writeToURL:contentEditingOutput.renderedContentURL atomically:YES];
    changeRequest.contentEditingOutput = contentEditingOutput;
 
} completionHandler:^(BOOL success, NSError *error) {
    if (!success) NSLog(@"Can't create asset: %@", error);
}];
```

In this example, the app first uses a [`PHAssetChangeRequest`](/documentation/Photos/PHAssetChangeRequest) object to request creation of a new asset with the unedited image captured from the camera (`originalJPEGFileURL`). Then, it creates a [`PHContentEditingOutput`](/documentation/Photos/PHContentEditingOutput) object with the [`placeholderForCreatedAsset`](/documentation/Photos/PHAssetChangeRequest/placeholderForCreatedAsset) object provided by the change request. Finally, it provides filtered image data (`adjustedJPEGData`) and adjustment data describing the filters (`adjustmentData`) to the editing output and adds the editing output to the change request.

> Note:
> If your app edits the contents of assets already in the Photos library — including assets your app has itself recently added — Photos prompts the user for permission to change the asset’s content. If instead your app uses the ``doc://com.apple.photokit/documentation/Photos/PHContentEditingOutput/init(placeholderForCreatedAsset:)`` method to create an asset with edited content, Photos recognizes your app’s ownership of the content and therefore doesn’t need to prompt the user for permission to edit it.

---

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)