One Logo Pool Ball
Photos · IOS API REFERENCE

PHAssetResourceManager

class · iOS 9.0+ · SDK 27.1

class PHAssetResourceManager

Members (6)

static · iOS 9.0+

default

TypeScript
static default(): PHAssetResourceManager
Swift declaration
class func `default`() -> PHAssetResourceManager
method · iOS 9.0+

cancelDataRequest

TypeScript
cancelDataRequest(requestID: number): void
Swift declaration
func cancelDataRequest(_ requestID: PHAssetResourceDataRequestID)
init

init

TypeScript
static init(): PHAssetResourceManager
Swift declaration
init()
method · iOS 9.0+

requestData

TypeScript
requestData(resource: PHAssetResource, options: (PHAssetResourceRequestOptions) | null, handler: ((arg0: ArrayBuffer) => void), completionHandler: ((arg0: (NativeError) | null) => void)): number
Swift declaration
func requestData(for resource: PHAssetResource, options: PHAssetResourceRequestOptions?, dataReceivedHandler handler: @escaping (Data) -> Void, completionHandler: @escaping ((any Error)?) -> Void) -> PHAssetResourceDataRequestID
method · iOS 9.0+

writeData

TypeScript
writeData(resource: PHAssetResource, fileURL: string, options: (PHAssetResourceRequestOptions) | null, completionHandler: ((arg0: (NativeError) | null) => void)): void
Swift declaration
func writeData(for resource: PHAssetResource, toFile fileURL: URL, options: PHAssetResourceRequestOptions?) async throws
method · iOS 27.0+

exportedAssetID

TypeScript
exportedAssetID(resource: PHAssetResource): Promise<_CloudKit_CKAsset_ExportedAssetID>
Swift declaration
func exportedAssetID(for resource: PHAssetResource) async throws -> CKAsset.ExportedAssetID

Returns the exported asset ID for the specified asset resource. 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``. - Parameter resource: The asset resource to get an exported asset ID for. - Returns: The exported asset ID for the resource. - Throws: ``CancellationError`` if the task is cancelled, or another error if the request fails.

Skipped declarations

No declarations were skipped in this snapshot.

All Photos types →