---
title: "foundRange(_:searchString:document:)"
framework: uikit
role: symbol
role_heading: Instance Method
path: "uikit/uitextsearchaggregator-swift.struct/foundrange(_:searchstring:document:)"
---

# foundRange(_:searchString:document:)

Adds a text range to the set of matches.

## Declaration

```swift
func foundRange(_ range: UITextRange, searchString: String, document: DocumentIdentifier)
```

## Parameters

- `range`: The text range to add to the set of matches.
- `searchString`: 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(_:document:)](uikit/uitextsearchaggregator-swift.struct/invalidatefoundrange(_:document:).md)
- [invalidate()](uikit/uitextsearchaggregator-swift.struct/invalidate().md)
- [finishedSearching()](uikit/uitextsearchaggregator-swift.struct/finishedsearching().md)
- [allFoundRanges](uikit/uitextsearchaggregator-swift.struct/allfoundranges.md)
