<!--
{
  "availability" : [
    "iOS: 16.0.0 -",
    "iPadOS: 16.0.0 -",
    "macCatalyst: 16.0.0 -",
    "tvOS: -",
    "visionOS: 1.0.0 -",
    "watchOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "UIKit",
  "identifier" : "/documentation/UIKit/UITextSearching-53wjq/replaceAllOccurrencesOfQueryString:usingOptions:withText:",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "UIKit"
    ],
    "preciseIdentifier" : "c:objc(pl)UITextSearching(im)replaceAllOccurrencesOfQueryString:usingOptions:withText:"
  },
  "title" : "replaceAllOccurrencesOfQueryString:usingOptions:withText:"
}
-->

# replaceAllOccurrencesOfQueryString:usingOptions:withText:

Informs the searchable object to replace all matching text across all searchable documents.

```
- (void) replaceAllOccurrencesOfQueryString:(NSString *) queryString usingOptions:(UITextSearchOptions *) options withText:(NSString *) replacementText;
```

## Parameters

`queryString`

The string to search for and replace.

`options`

The configurable options to use for matching words and comparing strings.

`replacementText`

The string to replace the text with.

## Discussion

When [`supportsTextReplacement`](/documentation/UIKit/UITextSearching-53wjq/supportsTextReplacement) returns `YES,` the system calls this method during a find session to request the replacement of all text matching the query string.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)