<!--
{
  "availability" : [
    "iOS: 16.0.0 -",
    "iPadOS: 16.0.0 -",
    "macCatalyst: 16.0.0 -",
    "tvOS: -",
    "visionOS: 1.0.0 -",
    "watchOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "UIKit",
  "identifier" : "/documentation/UIKit/UITextSearching-53wjq/willHighlightFoundTextRange:inDocument:",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "UIKit"
    ],
    "preciseIdentifier" : "c:objc(pl)UITextSearching(im)willHighlightFoundTextRange:inDocument:"
  },
  "title" : "willHighlightFoundTextRange:inDocument:"
}
-->

# willHighlightFoundTextRange:inDocument:

Informs the searchable object when the highlighted search result is about to change.

```
- (void) willHighlightFoundTextRange:(UITextRange *) range inDocument:(UITextSearchDocumentIdentifier) document;
```

## Parameters

`range`

The text range to highlight.

`document`

A string that uniquely identifies the document containing the text range. `Nil` when searching a single document.

---

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)