PSPDFInlineSearchManager

Objective-C


@interface PSPDFInlineSearchManager : NSObject <PSPDFOverridable>

Swift

class InlineSearchManager : NSObject, Overridable

InlineSearchManager manages the presentation of a search bar that may be used to find text in a Document. The search bar sides down from the top, typically covering the navigation bar.

  • 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.

    Declaration

    Objective-C

    - (nonnull instancetype)initWithPresentationContext:
        (nonnull id<PSPDFPresentationContext>)presentationContext;

    Swift

    init(presentationContext: PresentationContext)
  • Presents a search bar, optionally with pre-filled text.

    Declaration

    Objective-C

    - (void)presentInlineSearchWithSearchText:(nullable NSString *)text
                                     animated:(BOOL)animated;

    Swift

    func presentInlineSearch(withSearchText text: String?, animated: Bool)

    Parameters

    text

    Text to show in the search bar initially, or nil if the bar should start empty.

    animated

    A Boolean value specifying whether to animate the search bar sliding down from above the container view.

  • Hides the previously presented search bar.

    Declaration

    Objective-C

    - (BOOL)hideInlineSearchAnimated:(BOOL)animated;

    Swift

    func hideInlineSearch(animated: Bool) -> Bool

    Parameters

    animated

    A Boolean value specifying whether to animate the search bar sliding up to above the container view.

  • Hides the keyboard, but the search UI stays visible.

    Declaration

    Objective-C

    - (void)hideKeyboard;

    Swift

    func hideKeyboard()
  • Returns YES is search UI is visible. Returns yes even if search UI is currently being presented/dismissed.

    Declaration

    Objective-C

    @property (nonatomic, readonly, getter=isSearchVisible) BOOL searchVisible;

    Swift

    var isSearchVisible: Bool { get }
  • The configuration data source for this class.

    Declaration

    Objective-C

    @property (nonatomic, weak, readonly) id<PSPDFPresentationContext> _Nullable presentationContext;

    Swift

    weak var presentationContext: PresentationContext? { get }
  • Internally used PSPDFTextSearch object. (is a copy of the PSPDFTextSearch class in document)

    Declaration

    Objective-C

    @property (nonatomic, readonly, nullable) PSPDFTextSearch *textSearch;

    Swift

    var textSearch: TextSearch? { get }
  • Current searchText.

    Declaration

    Objective-C

    @property (nonatomic, copy, readonly) NSString *_Nonnull searchText;

    Swift

    var searchText: String { get }
  • Currently loaded search results.

    Declaration

    Objective-C

    @property (nonatomic, copy, readonly) NSArray<PSPDFSearchResult *> *_Nonnull searchResults;

    Swift

    var searchResults: [SearchResult] { get }
  • Current search status.

    Declaration

    Objective-C

    @property (nonatomic, readonly) PSPDFSearchStatus searchStatus;

    Swift

    var searchStatus: SearchViewController.Status { get }
  • The inline search manager delegate that notifies show/hide and when a search result is focussed.

    Declaration

    Objective-C

    @property (nonatomic, weak) id<PSPDFInlineSearchManagerDelegate> _Nullable delegate;

    Swift

    weak var delegate: InlineSearchManagerDelegate? { get set }
  • The document to be searched. Assigning a new document resets and hides the search bar.

    Declaration

    Objective-C

    @property (nonatomic, nullable) PSPDFDocument *document;

    Swift

    var document: Document? { get set }
  • The maximum number of results that may be displayed. Setting this too high may cause slowdown. Defaults to 600.

    Declaration

    Objective-C

    @property (nonatomic) NSUInteger maximumNumberOfSearchResultsDisplayed;

    Swift

    var maximumNumberOfSearchResultsDisplayed: UInt { get set }
  • Will include annotations that have a matching type into the search results. (contents will be searched). Defaults to PSPDFAnnotationTypeAll&~PSPDFAnnotationTypeLink.

    Note

    Requires the Features.annotationEditing feature flag.

    Declaration

    Objective-C

    @property (nonatomic) PSPDFAnnotationType searchableAnnotationTypes;

    Swift

    var searchableAnnotationTypes: Annotation.Kind { get set }
  • Returns whether search UI is currently being presented.

    Declaration

    Objective-C

    @property (nonatomic, readonly, getter=isBeingPresented) BOOL beingPresented;

    Swift

    var isBeingPresented: Bool { get }
  • Returns whether search UI is currently being dismissed.

    Declaration

    Objective-C

    @property (nonatomic, readonly, getter=isBeingDismissed) BOOL beingDismissed;

    Swift

    var isBeingDismissed: Bool { get }
  • Specifies the top padding of the search results label. Defaults to 10.

    Declaration

    Objective-C

    @property (nonatomic) CGFloat searchResultsLabelDistance;

    Swift

    var searchResultsLabelDistance: CGFloat { get set }