---
title: "requestContentEditingInput(with:completionHandler:)"
framework: photos
role: symbol
role_heading: Instance Method
path: "photos/phasset/requestcontenteditinginput(with:completionhandler:)"
---

# requestContentEditingInput(with:completionHandler:)

Requests asset information for beginning a content editing session.

## Declaration

```swift
func requestContentEditingInput(with options: PHContentEditingInputRequestOptions?, completionHandler: @escaping (PHContentEditingInput?, [AnyHashable : Any]) -> Void) -> PHContentEditingInputRequestID
```

## Parameters

- `options`: Options affecting how Photos handles an edit session request.
- `completionHandler`: A block that Photos calls when the requested asset editing information is ready. The block takes the following parameters: In iOS 10.0, tvOS 10.0, and later, Photos always calls this block on the main queue. In earlier releases, Photos calls this block on an arbitrary serial queue—if your block needs to update the UI, dispatch that work to the main queue.

## Mentioned in

Editing Asset Content

## Return Value

Return Value A numeric identifier for the request. Pass this identifier to the cancelContentEditingInputRequest(_:) method if you need to cancel the request before it completes.

## Discussion

Discussion When you call this method, Photos downloads the asset’s image or video data (if necessary) and prepares it for editing, then calls your completionHandler block to provide a PHContentEditingInput object you use for editing. To complete the edit, create a PHContentEditingOutput object from the editing input to provide the edited asset data. Then, commit the edit by posting a change block to the shared PHPhotoLibrary object. In the block, create a PHAssetChangeRequest object and set its contentEditingOutput property to the editing output you created.

## See Also

### Editing an Asset

- [Editing Asset Content](photokit/editing-asset-content.md)
- [PHContentEditingInput](photos/phcontenteditinginput.md)
- [PHContentEditingOutput](photos/phcontenteditingoutput.md)
- [PHAdjustmentData](photos/phadjustmentdata.md)
- [PHContentEditingInputRequestOptions](photos/phcontenteditinginputrequestoptions.md)
- [PHLivePhotoEditingContext](photos/phlivephotoeditingcontext.md)
- [PHLivePhotoFrame](photos/phlivephotoframe.md)
- [canPerform(_:)](photos/phasset/canperform(_:).md)
- [PHAssetEditOperation](photos/phasseteditoperation.md)
- [cancelContentEditingInputRequest(_:)](photos/phasset/cancelcontenteditinginputrequest(_:).md)
- [PHContentEditingInputRequestID](photos/phcontenteditinginputrequestid.md)
- [Editing Request Info Keys](photokit/editing-request-info-keys.md)
