---
title: UITextSearching
framework: uikit
role: symbol
role_heading: Protocol
path: uikit/uitextsearching-3wkjv
---

# UITextSearching

The methods you use on a find session’s searchable objects to perform search operations and decorate the found text results.

## Declaration

```swift
protocol UITextSearching : NSObjectProtocol
```

## Overview

Overview Implement this protocol on the class that encapsulates the searchable content for your view. This allows you to use an instance of UITextSearchingFindSession to manage the session for a find interaction.

## Topics

### Handling searches

- [performTextSearch(queryString:options:resultAggregator:)](uikit/uitextsearching-3wkjv/performtextsearch(querystring:options:resultaggregator:).md)
- [UITextSearchAggregator](uikit/uitextsearchaggregator-swift.struct.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)

### Displaying results

- [decorate(foundTextRange:document:usingStyle:)](uikit/uitextsearching-3wkjv/decorate(foundtextrange:document:usingstyle:).md)
- [clearAllDecoratedFoundText()](uikit/uitextsearching-3wkjv/clearalldecoratedfoundtext().md)
- [willHighlight(foundTextRange:document:)](uikit/uitextsearching-3wkjv/willhighlight(foundtextrange:document:).md)
- [scrollRangeToVisible(_:inDocument:)](uikit/uitextsearching-3wkjv/scrollrangetovisible(_:indocument:).md)

### Identifying selected text

- [selectedTextRange](uikit/uitextsearching-3wkjv/selectedtextrange.md)
- [selectedTextSearchDocument](uikit/uitextsearching-3wkjv/selectedtextsearchdocument.md)

### Handling replacements

- [supportsTextReplacement](uikit/uitextsearching-3wkjv/supportstextreplacement.md)
- [replace(foundTextRange:document:withText:)](uikit/uitextsearching-3wkjv/replace(foundtextrange:document:withtext:).md)
- [replaceAll(queryString:options:withText:)](uikit/uitextsearching-3wkjv/replaceall(querystring:options:withtext:).md)
- [shouldReplace(foundTextRange:document:withText:)](uikit/uitextsearching-3wkjv/shouldreplace(foundtextrange:document:withtext:).md)

## Relationships

### Inherits From

- [NSObjectProtocol](objectivec/nsobjectprotocol.md)

### Conforming Types

- [UITextView](uikit/uitextview.md)

## See Also

### Find and replace

- [UIFindInteraction](uikit/uifindinteraction.md)
- [UIFindInteractionDelegate](uikit/uifindinteractiondelegate.md)
- [UIFindSession](uikit/uifindsession.md)
- [UITextSearchingFindSession](uikit/uitextsearchingfindsession.md)
- [UITextSearchOptions](uikit/uitextsearchoptions.md)
- [UITextSearchFoundTextStyle](uikit/uitextsearchfoundtextstyle.md)
- [UITextSearchOptions.WordMatchMethod](uikit/uitextsearchoptions/wordmatchmethod-swift.enum.md)
- [UIFindSession.SearchResultDisplayStyle](uikit/uifindsession/searchresultdisplaystyle-swift.enum.md)
