---
title: "getHighlightFor(_:completionHandler:)"
framework: sharedwithyou
role: symbol
role_heading: Instance Method
path: "sharedwithyou/swhighlightcenter/gethighlightfor(_:completionhandler:)"
---

# getHighlightFor(_:completionHandler:)

Returns a highlight for a specified URL.

## Declaration

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

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

## Parameters

- `URL`: The URL that the system uses to find the doc://com.apple.sharedwithyou/documentation/SharedWithYou/SWHighlight.
- `completionHandler`: Returns the doc://com.apple.sharedwithyou/documentation/SharedWithYou/SWHighlight. The system invokes the completion handler on the main thread.

## See Also

### Retrieving collaboration highlights

- [isSystemCollaborationSupportAvailable](sharedwithyou/swhighlightcenter/issystemcollaborationsupportavailable.md)
- [collaborationHighlight(forIdentifier:)](sharedwithyou/swhighlightcenter/collaborationhighlight(foridentifier:)-23ytv.md)
- [collaborationHighlight(forIdentifier:)](sharedwithyou/swhighlightcenter/collaborationhighlight(foridentifier:)-87lhr.md)
- [getCollaborationHighlight(for:completionHandler:)](sharedwithyou/swhighlightcenter/getcollaborationhighlight(for:completionhandler:).md)
- [getSignedIdentityProof(for:using:completionHandler:)](sharedwithyou/swhighlightcenter/getsignedidentityproof(for:using:completionhandler:).md)
