---
title: "willHighlight(foundTextRange:document:)"
framework: uikit
role: symbol
role_heading: Instance Method
path: "uikit/uitextsearching-3wkjv/willhighlight(foundtextrange:document:)"
---

# willHighlight(foundTextRange:document:)

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

## Declaration

```swift
func willHighlight(foundTextRange: UITextRange, document: Self.DocumentIdentifier?)
```

## Parameters

- `foundTextRange`: The text range to highlight.
- `document`: A string that uniquely identifies the document containing the text range. Nil when searching a single document.

## See Also

### Displaying results

- [decorate(foundTextRange:document:usingStyle:)](uikit/uitextsearching-3wkjv/decorate(foundtextrange:document:usingstyle:).md)
- [clearAllDecoratedFoundText()](uikit/uitextsearching-3wkjv/clearalldecoratedfoundtext().md)
- [scrollRangeToVisible(_:inDocument:)](uikit/uitextsearching-3wkjv/scrollrangetovisible(_:indocument:).md)
