---
title: "foundRange:forSearchString:inDocument:"
framework: uikit
role: symbol
role_heading: Instance Method
path: "uikit/uitextsearchaggregator-c.protocol/foundrange:forsearchstring:indocument:"
---

# foundRange:forSearchString:inDocument:

Adds a text range to the set of matches.

## Declaration

```occ
- (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

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

## See Also

### Tracking search results

- [invalidateFoundRange:inDocument:](uikit/uitextsearchaggregator-c.protocol/invalidatefoundrange:indocument:.md)
- [invalidate](uikit/uitextsearchaggregator-c.protocol/invalidate.md)
- [finishedSearching](uikit/uitextsearchaggregator-c.protocol/finishedsearching.md)
- [allFoundRanges](uikit/uitextsearchaggregator-c.protocol/allfoundranges.md)
