---
title: "shouldReplaceFoundTextInRange:inDocument:withText:"
framework: uikit
role: symbol
role_heading: Instance Method
path: "uikit/uitextsearching-53wjq/shouldreplacefoundtextinrange:indocument:withtext:"
---

# shouldReplaceFoundTextInRange:inDocument:withText:

Determines whether the searchable object allows replacement of the text range you provide.

## Declaration

```occ
- (BOOL) shouldReplaceFoundTextInRange:(UITextRange *) range inDocument:(UITextSearchDocumentIdentifier) document withText:(NSString *) replacementText;
```

## Parameters

- `range`: The range of characters in a text container to consider a replacement for.
- `document`: A string that uniquely identifies the document containing the text range.
- `replacementText`: The string to replace the text with.

## Return Value

Return Value Return No to prevent the replacement of a particular text range.

## Discussion

Discussion Returning NO from this method disables the “replace” button in the find panel. If you don’t implement this method, the system assumes all results are replacable.

## See Also

### Handling replacements

- [supportsTextReplacement](uikit/uitextsearching-53wjq/supportstextreplacement.md)
- [replaceFoundTextInRange:inDocument:withText:](uikit/uitextsearching-53wjq/replacefoundtextinrange:indocument:withtext:.md)
- [replaceAllOccurrencesOfQueryString:usingOptions:withText:](uikit/uitextsearching-53wjq/replacealloccurrencesofquerystring:usingoptions:withtext:.md)
