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

# foundRange:forSearchString:inDocument:

Adds a text range to the set of matches.

```
- (void) foundRange:(UITextRange *) range forSearchString:(NSString *) string inDocument:(UITextSearchDocumentIdentifier) document;
```

## Parameters

`range`

The text range to add to the set of matches.

`string`

The query string the search used to locate this range of text.

`document`

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

## Discussion

Call this method to add a text range found in your document to the set of matches.

---

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)