performTextSearch(queryString:options:resultAggregator:)
Searches for ranges of text matching the string across all searchable documents and collects results in the aggregator.
Declaration
func performTextSearch(queryString: String, options: UITextSearchOptions, resultAggregator: UITextSearchAggregator<Self.DocumentIdentifier>)Parameters
- queryString:
The string to search for.
- options:
The configurable options to use for matching words and comparing strings.
- resultAggregator:
An object you use to collect matching results. The aggregator is thread-safe, so you may send it messages on other threads.
Discussion
The system calls this method during a find session to perform the search. Your implenentation should search for matching text ranges in your app’s documents and call foundRange(_:searchString:document:) on the aggregator object to add them to the set of matching ranges.