---
title: UITextSearchAggregator
framework: uikit
role: symbol
role_heading: Structure
path: uikit/uitextsearchaggregator-swift.struct
---

# UITextSearchAggregator

The methods you use on a find session’s aggregator to collect matching text ranges for a search.

## Declaration

```swift
struct UITextSearchAggregator<DocumentIdentifier> where DocumentIdentifier : Hashable
```

## Overview

Overview To track text ranges that match the search, call these methods on the aggregator for the searchable object implementing the UITextSearching protocol for a UITextSearchingFindSession.

## Topics

### Tracking search results

- [foundRange(_:searchString:document:)](uikit/uitextsearchaggregator-swift.struct/foundrange(_:searchstring:document:).md)
- [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)

## See Also

### Handling searches

- [performTextSearch(queryString:options:resultAggregator:)](uikit/uitextsearching-3wkjv/performtextsearch(querystring:options:resultaggregator:).md)
- [compare(_:toRange:document:)](uikit/uitextsearching-3wkjv/compare(_:torange:document:).md)
- [compare(document:toDocument:)](uikit/uitextsearching-3wkjv/compare(document:todocument:).md)
- [DocumentIdentifier](uikit/uitextsearching-3wkjv/documentidentifier.md)
