---
title: "Search PDF Annotations on iOS | Nutrient SDK"
canonical_url: "https://www.nutrient.io/guides/ios/search/search-in-a-pdf/annotation-search/"
md_url: "https://www.nutrient.io/guides/ios/search/search-in-a-pdf/annotation-search.md"
last_updated: "2026-06-08T19:21:59.244Z"
description: "Learn to search PDF annotations on iOS using Nutrient iOS SDK. Customize search behavior, limit annotation types, and enhance user experience with specific features."
---

# Search PDF Annotations on iOS

PSPDFKit offers many different ways to search a document, including using a highly customizable UI component. The search functionality also supports searching for text contained in PDF annotations as comments, [replies](https://www.nutrient.io/guides/ios/annotations/replies.md), and [form fields](https://www.nutrient.io/guides/ios/forms.md) (text fields, combo box fields, and list box fields).

Before reading this guide any further, check out the [text search](https://www.nutrient.io/guides/ios/features/text-search.md) guide to familiarize yourself with the text search APIs that form the basis of searching for annotation results.

## Searching via PSPDFViewController

PSPDFKit will automatically search for text contained in annotations and form fields when using the built-in search UI via the provided search bar button item, or when displaying the search UI programmatically using [`search(for:options:sender:animated:)`](https://www.nutrient.io/api/ios/documentation/pspdfkitui/pdfviewcontroller/search(for:options:sender:animated:)). This behavior is controlled using the [`SearchViewController.searchableAnnotationTypes`](https://www.nutrient.io/api/ios/documentation/pspdfkitui/searchviewcontroller/searchableannotationtypes) property, which defaults to all annotation types except links.

If you’d like to customize this behavior to limit searching to a different set of annotation types or to disable annotation search completely, you can use PSPDFKit’s [class override system](https://www.nutrient.io/guides/ios/getting-started/overriding-classes.md) to subclass [`SearchViewController`](https://www.nutrient.io/api/ios/documentation/pspdfkitui/searchviewcontroller) and override the property value.

The example below shows how to disable annotation search:

```swift

// Set the override when creating your PDF controller.
let controller = PDFViewController(document: document) {
    $0.overrideClass(SearchViewController.self, with: CustomSearchViewController.self)
}

// Overrides the class definition.
private class CustomSearchViewController: SearchViewController {
    override init(document: Document?) {
        super.init(document: document)
        // Disable annotation search.
        searchableAnnotationTypes = []
    }
}

```

## Searching Manually

In contrast to the built-in UI, annotations and form fields won’t be searched by default when using the [`TextSearch`](https://www.nutrient.io/api/ios/documentation/pspdfkit/textsearch) class to search a PDF programmatically. You can change this behavior by setting the [`TextSearch.searchableAnnotationTypes`](https://www.nutrient.io/api/ios/documentation/pspdfkit/textsearch/searchableannotationtypes) property to a set of annotation types before triggering search, via calling [`search(for:)`](https://www.nutrient.io/api/ios/documentation/pspdfkit/textsearch/search(for:)). To receive search results, implement [`TextSearchDelegate`](https://www.nutrient.io/api/ios/documentation/pspdfkit/textsearchdelegate) on the receiving object and set the text search object’s `delegate` to your object.

The [`didUpdate(_:term:searchResults:pageIndex:)`](https://www.nutrient.io/api/ios/documentation/pspdfkit/textsearchdelegate/didupdate(_:term:newsearchresults:pageindex:)) delegate will be notified of search results within annotations and form fields alongside text results from the page content. Both are received in the form of [`SearchResult`](https://www.nutrient.io/api/ios/documentation/pspdfkit/searchresult) objects, whereby annotation and form field results can be identified by having an annotation or form field reference associated with the [`SearchResult.annotation`] property.

> **❗ Important:** You need to retain the text search object while the search is running. Otherwise, any running search will automatically be canceled, and your delegate won’t get called.
---

## Related pages

- [Search for Text in PDFs on iOS](/guides/ios/features/text-search.md)

