<!--
{
  "availability" : [
    "iOS: 16.0.0 -",
    "iPadOS: 16.0.0 -",
    "macCatalyst: 16.0.0 -",
    "macOS: 13.0.0 -",
    "tvOS: 16.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "SharedWithYou",
  "identifier" : "/documentation/SharedWithYou/SWHighlightCenter/getHighlightFor(_:completionHandler:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Shared with You"
    ],
    "preciseIdentifier" : "c:objc(cs)SWHighlightCenter(im)getHighlightForURL:completionHandler:"
  },
  "title" : "getHighlightFor(_:completionHandler:)"
}
-->

# getHighlightFor(_:completionHandler:)

Returns a highlight for a specified URL.

```
func getHighlightFor(_ URL: URL, completionHandler: @escaping @Sendable (SWHighlight?, (any Error)?) -> Void)
```

```
func highlight(for URL: URL) async throws -> SWHighlight
```

## Parameters

`URL`

The URL that the system uses to find the [`SWHighlight`](/documentation/SharedWithYou/SWHighlight).

`completionHandler`

Returns the [`SWHighlight`](/documentation/SharedWithYou/SWHighlight). The system invokes the completion handler on the main thread.

---

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)