<!--
{
  "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/UITextSearchAggregator-c.protocol/invalidateFoundRange:inDocument:",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "UIKit"
    ],
    "preciseIdentifier" : "c:objc(pl)UITextSearchAggregator(im)invalidateFoundRange:inDocument:"
  },
  "title" : "invalidateFoundRange:inDocument:"
}
-->

# invalidateFoundRange:inDocument:

Removes a text range from the set of matches.

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

## 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

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

---

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)