PSPDFSearchHighlightViewManager

Objective-C


@interface PSPDFSearchHighlightViewManager : NSObject <PSPDFOverridable>

Swift

class SearchHighlightViewManager : NSObject, Overridable

Manages views added on PDFPageView.

  • Unavailable

    Not the designated initializer

    Undocumented

    Declaration

    Objective-C

    PSPDF_EMPTY_INIT_UNAVAILABLE
  • Unavailable

    Not the designated initializer

    Undocumented

    Declaration

    Objective-C

    PSPDF_EMPTY_INIT_UNAVAILABLE
  • Designated initializer.

    Typically you shouldn’t create an instance of this class and should instead use the searchHighlightViewManager property of PDFViewController.

    Declaration

    Objective-C

    - (nonnull instancetype)initWithDataSource:
        (nonnull id<PSPDFSearchHighlightViewManagerDataSource>)dataSource;

    Swift

    init(dataSource: SearchHighlightViewManagerDataSource)
  • The data source for the search highlight manager.

    Declaration

    Objective-C

    @property (nonatomic, weak, readonly) id<PSPDFSearchHighlightViewManagerDataSource> _Nullable dataSource;

    Swift

    weak var dataSource: SearchHighlightViewManagerDataSource? { get }
  • Returns YES if there are search results displayed on a page view.

    Declaration

    Objective-C

    @property (nonatomic, readonly) BOOL hasVisibleSearchResults;

    Swift

    var hasVisibleSearchResults: Bool { get }
  • Hides search results.

    Note

    animated is currently ignored.

    Declaration

    Objective-C

    - (void)clearHighlightedSearchResultsAnimated:(BOOL)animated;

    Swift

    func clearHighlightedSearchResults(animated: Bool)
  • Adds search result highlights to visible page views.

    Adding results for pages that are not visible will have no effect. You should call this method again when the visible page views change, which you can observe using the PDFViewControllerDelegate method pdfViewController(_:willBeginDisplaying:forPageAt:).

    Calling this multiple times with the equal search results has no effect. In other words, there is no need to worry about adding duplicate highlights for the same result.

    Declaration

    Objective-C

    - (void)addHighlightSearchResults:
                (nonnull NSArray<PSPDFSearchResult *> *)searchResults
                             animated:(BOOL)animated;

    Swift

    func addHighlight(_ searchResults: [PSPDFSearchResult], animated: Bool)
  • Animates a search result highlight with a zoom/flash animation to draw attention.

    The highlight must have previously been added using addHighlight(_:animated:).

    This has no effect if the search result is on a page that is not visible.

    Declaration

    Objective-C

    - (void)animateSearchHighlight:(nonnull PSPDFSearchResult *)searchResult;

    Swift

    func animateSearchHighlight(_ searchResult: PSPDFSearchResult)