<!--
{
  "availability" : [
    "iOS: 13.0.0 -",
    "iPadOS: 13.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.15.0 -",
    "tvOS: 18.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 9.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "LinkPresentation",
  "identifier" : "/documentation/LinkPresentation/LPMetadataProvider/cancel()",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Link Presentation"
    ],
    "preciseIdentifier" : "c:objc(cs)LPMetadataProvider(im)cancel"
  },
  "title" : "cancel()"
}
-->

# cancel()

Cancels a metadata request.

```
func cancel()
```

## Discussion

This method invokes the completion handler with the error code
[`LPError.Code.metadataFetchCancelled`](/documentation/LinkPresentation/LPError/Code/metadataFetchCancelled) if the request hasn’t already
completed.

---

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)