---
title: PHAssetCreationRequest
framework: photos
role: symbol
role_heading: Class
path: photos/phassetcreationrequest
---

# PHAssetCreationRequest

A request to create a new Photos asset from underlying data resources, for use in a photo library change block.

## Declaration

```swift
class PHAssetCreationRequest
```

## Mentioned in

Delivering an Enhanced Privacy Experience in Your Photos App

## Overview

Overview A PHAssetCreationRequest object, used within a photo library change block, constructs a new photo or video asset from data resources, and adds it to the Photos library. This class works in terms of the raw data resources that together form an asset, so you can use it together with the PHAssetResource class to perform a complete copy (or backup and restore) of an asset’s underlying resources. To instead simply create a new asset from an image object, image file, or video file, see the superclass PHAssetChangeRequest. To create a new asset from data resources, first start a change block using the shared PHPhotoLibrary method performChanges(_:completionHandler:) or performChangesAndWait(_:). Then, within the change block: Within the change block, create a new asset creation request with the forAsset() method. Add image, video, or data resources using the methods in the Providing Data Resources for the New Asset section below. (Optional.) Set metadata for the new asset using methods and properties of the superclass PHAssetChangeRequest. After Photos runs the change block and calls your completion handler, the new asset is created in the Photos library. If you instantiate or use this class outside a photo library change block, Photos throws an exception. For details on change blocks, see PHPhotoLibrary.

## Topics

### Requesting Asset Creation

- [forAsset()](photos/phassetcreationrequest/forasset().md)

### Preflighting a Request

- [supportsAssetResourceTypes(_:)](photos/phassetcreationrequest/supportsassetresourcetypes(_:).md)

### Providing Data Resources for the New Asset

- [addResource(with:data:options:)](photos/phassetcreationrequest/addresource(with:data:options:).md)
- [addResource(with:fileURL:options:)](photos/phassetcreationrequest/addresource(with:fileurl:options:).md)

### Instance Properties

- [originalResourceChoice](photos/phassetcreationrequest/originalresourcechoice.md)

## Relationships

### Inherits From

- [PHAssetChangeRequest](photos/phassetchangerequest.md)

### Conforms To

- [CVarArg](swift/cvararg.md)
- [CustomDebugStringConvertible](swift/customdebugstringconvertible.md)
- [CustomStringConvertible](swift/customstringconvertible.md)
- [Equatable](swift/equatable.md)
- [Hashable](swift/hashable.md)
- [NSObjectProtocol](objectivec/nsobjectprotocol.md)

## See Also

### Asset resource management

- [PHAssetResource](photos/phassetresource.md)
- [PHAssetResourceCreationOptions](photos/phassetresourcecreationoptions.md)
- [PHAssetResourceManager](photos/phassetresourcemanager.md)
- [PHAssetResourceRequestOptions](photos/phassetresourcerequestoptions.md)
