Platforms to show: All Mac Windows Linux Cross-Platform

Back to PHAssetResourceManagerMBS class.

PHAssetResourceManagerMBS.cancelDataRequest(requestID as Integer)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Photos MBS Mac64bit Plugin 20.2 ✅ Yes ❌ No ❌ No ✅ Yes Desktop & iOS
Cancels an asynchronous request.

requestID: The numeric identifier of the request to be canceled.

When you perform an asynchronous request for asset resource data using the requestDataForAssetResource method, the image manager returns a numeric identifier for the request. To cancel the request before it completes, provide this identifier when calling the cancelDataRequest method.

PHAssetResourceManagerMBS.Constructor

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Photos MBS Mac64bit Plugin 20.2 ✅ Yes ❌ No ❌ No ✅ Yes Desktop & iOS
The constructor.

PHAssetResourceManagerMBS.requestDataForAssetResource(resource as PHAssetResourceMBS, options as PHAssetResourceRequestOptionsMBS, DataReceivedHandler as RequestDataForAssetResourceDataReceivedMBS, CompleteHandler as RequestDataForAssetResourceCompletedMBS, tag as variant = nil) as Integer

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Photos MBS Mac64bit Plugin 20.2 ✅ Yes ❌ No ❌ No ✅ Yes Desktop & iOS
Requests the underlying data for the specified asset resource, to be delivered asynchronously.

resource: The asset resource for which to request data.
options: Options specifying how Photos should handle the request and notify your app of progress. For details, see PHAssetResourceRequestOptionsMBS.

Returns a numeric identifier for the request. If you need to cancel the request before it completes, pass this identifier to the cancelDataRequest: method.

When you call this method, Photos begins asynchronously reading the underlying data for the asset resource. Depending on the options you specify and the current state of the asset, Photos may download asset data from the network.

While reading (or downloading) asset resource data, Photos calls your handler block at least once, progressively providing chunks of data. After reading all of the data, Photos calls your completionHandler block to indicate that the data is complete. (At this point, the complete data for the asset is the concatenation of the data parameters from all calls to your handler block.) If Photos cannot finish reading or downloading asset resource data, it calls your completionHandler block with a description of the error. Photos can also call the completionHandler block with a non-nil error when the data is complete if the user cancels downloading.

PHAssetResourceManagerMBS.writeDataForAssetResource(resource as PHAssetResourceMBS, file as FolderItem, options as PHAssetResourceRequestOptionsMBS, CompleteHandler as WriteDataForAssetResourceCompletedMBS, tag as variant = nil)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Photos MBS Mac64bit Plugin 20.2 ✅ Yes ❌ No ❌ No ✅ Yes Desktop & iOS
Requests the underlying data for the specified asset resource, to be asynchronously written to a local file.

resource: The asset resource for which to request data.
fileURL: A URL identifying the local filename at which to write the asset resource’s data.
options: Options specifying how Photos should handle the request and notify your app of progress. For details, see PHAssetResourceRequestOptionsMBS.

When you call this method, Photos begins asynchronously reading the underlying data for the asset resource. Depending on the options you specify and the current state of the asset, Photos may download asset data from the network.

While reading (or downloading) asset resource data, Photos progressively writes the data into the specified file. After writing all of the data, or if an error prevents reading all of the data, Photos calls your delegate.

The items on this page are in the following plugins: MBS Mac64bit Plugin.


The biggest plugin in space...