<!--
{
  "availability" : [
    "iOS: 26.4.0 -",
    "iPadOS: 26.4.0 -",
    "macCatalyst: 26.4.0 -",
    "macOS: 27.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "PhotoKit",
  "identifier" : "/documentation/Photos/PHAssetResourceUploadJobChangeRequest/cancel()",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Photos"
    ],
    "preciseIdentifier" : "c:objc(cs)PHAssetResourceUploadJobChangeRequest(im)cancel"
  },
  "title" : "cancel()"
}
-->

# cancel()

Cancels an upload job that is registered or pending.

```
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.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)