Class

PHAssetResource

An underlying data resource associated with a photo, video, or Live Photo asset in the Photos library.

Declaration

@interface PHAssetResource : NSObject

Overview

Each PHAsset object references one or more resources. Use these objects to work with those resources directly, like when backing up or restoring assets.

  • A photo asset can contain both JPEG and RAW files representing the same photo.

  • A Live Photo asset contains both still photo and video resources.

  • An edited asset contains resources representing asset content before and after the edit, as well as a resource corresponding to the PHAdjustmentData object that describes the edit.

To work with the data contained in an asset resource, fetch it using the PHAssetResourceManager class.

Topics

Retrieving an Asset’s Data Resources

+ assetResourcesForAsset:

Returns the list of data resources associated with an asset.

+ assetResourcesForLivePhoto:

Returns the list of data resources associated with a Live Photo object.

Examining an Asset Resource

type

The relationship of this asset resource to its owning asset.

PHAssetResourceType

Values identifying the relationship of an asset resource to its owning asset; used by the type property.

assetLocalIdentifier

The unique identifier for the asset object this resource is associated with.

uniformTypeIdentifier

The uniform type identifier for the asset resource’s image or video data.

originalFilename

The original filename of the asset resource from when it was created or imported.

Relationships

Inherits From

See Also

Asset Resource Management

PHAssetCreationRequest

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

PHAssetResourceCreationOptions

A set of options affecting the creation of a new Photos asset from underlying resources.

PHAssetResourceManager

A resource manager for the data storage underlying a Photos asset.

PHAssetResourceRequestOptions

A set of options affecting the delivery of underlying asset data that you request from the asset resource manager.