---
title: "invalidateFoundRange(_:document:)"
framework: uikit
role: symbol
role_heading: Instance Method
path: "uikit/uitextsearchaggregator-swift.struct/invalidatefoundrange(_:document:)"
---

# invalidateFoundRange(_:document:)

Removes a text range from the set of matches.

## Declaration

```swift
func invalidateFoundRange(_ range: UITextRange, document: DocumentIdentifier)
```

## Parameters

- `range`: The text range to remove from the set of matches.
- `document`: A string that uniquely identifies the document containing the text range. Nil when searching a single document.

## Discussion

Discussion Call this method to invalidate a text range when removing or changing text in the document. This causes the system find panel to update it’s current state, and if the range is the highlighted range, the find panel advances to the next found result.

## See Also

### Tracking search results

- [foundRange(_:searchString:document:)](uikit/uitextsearchaggregator-swift.struct/foundrange(_:searchstring:document:).md)
- [invalidate()](uikit/uitextsearchaggregator-swift.struct/invalidate().md)
- [finishedSearching()](uikit/uitextsearchaggregator-swift.struct/finishedsearching().md)
- [allFoundRanges](uikit/uitextsearchaggregator-swift.struct/allfoundranges.md)
