exportedAssetID(for:)
Returns the exported asset ID for the specified asset resource.
Declaration
func exportedAssetID(for resource: PHAssetResource) async throws -> CKAsset.ExportedAssetIDParameters
- resource:
The asset resource to get an exported asset ID for.
Return Value
The exported asset ID for the resource.
Discussion
The returned CKAsset.ExportedAssetID can be used to create a CKAsset that references the asset resource data without copying it. Network access is required; the request will fail if the resource cannot be resolved in CloudKit. Only resources belonging to PHAssetResource.TypeGroup.coreComponents are valid. The photo library must be cloud-enabled; requests against a local-only library will fail with PHPhotosError.requestNotSupportedForAsset.
This method supports task cancellation. If the calling task is cancelled, the underlying network request is cancelled and this method throws CancellationError.