PSPDFSearchViewControllerDelegate

Objective-C

@protocol PSPDFSearchViewControllerDelegate <PSPDFTextSearchDelegate>

Swift

protocol SearchViewControllerDelegate : TextSearchDelegate

Delegate for the search view controller.

Note

This is a specialization of PSPDFTextSearchDelegate.
  • Called when the user taps on a controller result cell.

    Declaration

    Objective-C

    - (void)searchViewController:
                (nonnull PSPDFSearchViewController *)searchController
              didTapSearchResult:(nonnull PSPDFSearchResult *)searchResult;

    Swift

    optional func searchViewController(_ searchController: SearchViewController, didTap searchResult: SearchResult)
  • Will be called when the controller clears all search results.

    Declaration

    Objective-C

    - (void)searchViewControllerDidClearAllSearchResults:
        (nonnull PSPDFSearchViewController *)searchController;

    Swift

    optional func searchViewControllerDidClearAllSearchResults(_ searchController: SearchViewController)
  • Asks for the visible pages to optimize search ordering.

    Declaration

    Objective-C

    - (nonnull NSIndexSet *)searchViewControllerGetVisiblePages:
        (nonnull PSPDFSearchViewController *)searchController;

    Swift

    optional func searchViewControllerGetVisiblePages(_ searchController: SearchViewController) -> IndexSet
  • Narrows down the search range if a scope is set.

    Declaration

    Objective-C

    - (nullable NSIndexSet *)
        searchViewController:(nonnull PSPDFSearchViewController *)searchController
         searchRangeForScope:(nonnull NSString *)scope;

    Swift

    optional func searchViewController(_ searchController: SearchViewController, searchRangeForScope scope: String) -> IndexSet?
  • Requests the text search class. Creates a custom class if not implemented.

    Declaration

    Objective-C

    - (nonnull PSPDFTextSearch *)searchViewControllerTextSearchObject:
        (nonnull PSPDFSearchViewController *)searchController;

    Swift

    optional func searchViewControllerTextSearchObject(_ searchController: SearchViewController) -> TextSearch