cancel()
Cancels an upload job that is registered or pending.
Declaration
func cancel()Discussion
Use this method to cancel an upload job that has not yet completed. This is useful when a resource is uploaded through another path (e.g., the main app) and the background upload job is no longer needed, avoiding wasteful duplicate uploads.
Only jobs in the PHAssetResourceUploadJobStateRegistered or PHAssetResourceUploadJobStatePending states can be cancelled. Cancelled jobs transition to the PHAssetResourceUploadJobStateCancelled state and are automatically acknowledged.